Changeset 71802 in webkit
- Timestamp:
- Nov 11, 2010 3:20:11 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 50 added
- 2 deleted
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r71799 r71802 1 2010-11-10 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Convert SVGMatrix/SVGTransform/SVGTransformList to the new SVGPropertyTearOff concept 6 https://bugs.webkit.org/show_bug.cgi?id=49311 7 8 Add tests covering StrictTypeChecking and RequiresAllArguments=Raise for SVGMatrix/SVGPoint. 9 Imported several new tests from SVG 1.1 2nd Edition, regarding SVG DOM primitives. 10 11 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.checksum: Added. 12 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.png: Added. 13 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.txt: Added. 14 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.checksum: Added. 15 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png: Added. 16 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.txt: Added. 17 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.checksum: Added. 18 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.png: Added. 19 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.txt: Added. 20 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.checksum: Added. 21 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.png: Added. 22 * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.txt: Added. 23 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.checksum: Added. 24 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.png: Added. 25 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.txt: Added. 26 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.checksum: Added. 27 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.png: Added. 28 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.txt: Added. 29 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.checksum: Added. 30 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.png: Added. 31 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.txt: Added. 32 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.checksum: Added. 33 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.png: Added. 34 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.txt: Added. 35 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-05-b-expected.checksum: Added. 36 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-05-b-expected.png: Added. 37 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-05-b-expected.txt: Added. 38 * svg/W3C-SVG-1.1-SE/coords-dom-01-f.svg: Added. 39 * svg/W3C-SVG-1.1-SE/coords-dom-02-f.svg: Added. 40 * svg/W3C-SVG-1.1-SE/coords-dom-03-f.svg: Added. 41 * svg/W3C-SVG-1.1-SE/coords-dom-04-f.svg: Added. 42 * svg/W3C-SVG-1.1-SE/types-dom-01-b.svg: Added. 43 * svg/W3C-SVG-1.1-SE/types-dom-02-f.svg: Added. 44 * svg/W3C-SVG-1.1-SE/types-dom-03-b.svg: Added. 45 * svg/W3C-SVG-1.1-SE/types-dom-04-b.svg: Added. 46 * svg/W3C-SVG-1.1-SE/types-dom-05-b.svg: Added. 47 * svg/dom/SVGMatrix-expected.txt: Added. 48 * svg/dom/SVGMatrix.html: Added. 49 * svg/dom/SVGPoint-expected.txt: 50 * svg/dom/SVGTransform-expected.txt: Added. 51 * svg/dom/SVGTransform.html: Added. 52 * svg/dom/SVGTransformList-expected.txt: Added. 53 * svg/dom/SVGTransformList.html: Added. 54 * svg/dom/script-tests/SVGMatrix.js: Added. 55 * svg/dom/script-tests/SVGPoint.js: 56 * svg/dom/script-tests/SVGTransform.js: Added. 57 * svg/dom/script-tests/SVGTransformList.js: Added. 58 1 59 2010-11-11 Kent Tamura <tkent@chromium.org> 2 60 -
trunk/LayoutTests/svg/animations/animate-gradient-transform-expected.txt
r59928 r71802 7 7 8 8 PASS gradient.gradientTransform.baseVal.consolidate().matrix.e is 0 9 PASS gradient.gradientTransform.animVal.consolidate().matrix.e is 09 PASS gradient.gradientTransform.animVal.consolidate().matrix.e threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7. 10 10 PASS gradient.gradientTransform.baseVal.consolidate().matrix.e is 100 11 PASS gradient.gradientTransform.animVal.consolidate().matrix.e is 10011 PASS gradient.gradientTransform.animVal.consolidate().matrix.e threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7. 12 12 PASS gradient.gradientTransform.baseVal.consolidate().matrix.e is 200 13 PASS gradient.gradientTransform.animVal.consolidate().matrix.e is 20013 PASS gradient.gradientTransform.animVal.consolidate().matrix.e threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7. 14 14 PASS successfullyParsed is true 15 15 -
trunk/LayoutTests/svg/animations/script-tests/animate-gradient-transform.js
r59928 r71802 47 47 // Check initial conditions 48 48 shouldBe("gradient.gradientTransform.baseVal.consolidate().matrix.e", "0"); 49 should Be("gradient.gradientTransform.animVal.consolidate().matrix.e", "0");49 shouldThrow("gradient.gradientTransform.animVal.consolidate().matrix.e"); 50 50 } 51 51 … … 54 54 // Check half-time conditions 55 55 shouldBe("gradient.gradientTransform.baseVal.consolidate().matrix.e", "100"); 56 should Be("gradient.gradientTransform.animVal.consolidate().matrix.e", "100");56 shouldThrow("gradient.gradientTransform.animVal.consolidate().matrix.e"); 57 57 } 58 58 … … 61 61 // Check end conditions 62 62 shouldBe("gradient.gradientTransform.baseVal.consolidate().matrix.e", "200"); 63 should Be("gradient.gradientTransform.animVal.consolidate().matrix.e", "200");63 shouldThrow("gradient.gradientTransform.animVal.consolidate().matrix.e"); 64 64 } 65 65 -
trunk/LayoutTests/svg/dom/SVGPoint-expected.txt
r71512 r71802 20 20 PASS point.x is 100 21 21 PASS point.y is 0 22 23 Reset to -50, 100 24 25 Check 'matrixTransform' method - multiply with -1,0,0,2,10,10 matrix, should flip x coordinate, multiply y by two and translate each coordinate by 10 26 PASS (newPoint = point.matrixTransform(ctm)).toString() is "[object SVGPoint]" 27 PASS newPoint.x is 60 28 PASS newPoint.y is 210 29 30 Check invalid arguments for 'matrixTransform' 31 PASS point.matrixTransform() threw exception SyntaxError: Not enough arguments. 32 PASS point.matrixTransform(-1) threw exception TypeError: Type error. 33 PASS point.matrixTransform(5) threw exception TypeError: Type error. 34 PASS point.matrixTransform('aString') threw exception TypeError: Type error. 35 PASS point.matrixTransform(point) threw exception TypeError: Type error. 36 PASS point.matrixTransform(svgElement) threw exception TypeError: Type error. 22 37 PASS successfullyParsed is true 23 38 -
trunk/LayoutTests/svg/dom/script-tests/SVGPoint.js
r71512 r71802 24 24 shouldBe("point.y", "0"); 25 25 26 debug(""); 27 debug("Reset to -50, 100"); 28 point.x = -50; 29 point.y = 100; 30 31 debug(""); 32 debug("Check 'matrixTransform' method - multiply with -1,0,0,2,10,10 matrix, should flip x coordinate, multiply y by two and translate each coordinate by 10"); 33 var ctm = svgElement.createSVGMatrix(); 34 ctm.a = -1; 35 ctm.d = 2; 36 ctm.e = 10; 37 ctm.f = 10; 38 shouldBeEqualToString("(newPoint = point.matrixTransform(ctm)).toString()", "[object SVGPoint]"); 39 shouldBe("newPoint.x", "60"); 40 shouldBe("newPoint.y", "210"); 41 42 debug(""); 43 debug("Check invalid arguments for 'matrixTransform'"); 44 shouldThrow("point.matrixTransform()"); 45 shouldThrow("point.matrixTransform(-1)"); 46 shouldThrow("point.matrixTransform(5)"); 47 shouldThrow("point.matrixTransform('aString')"); 48 shouldThrow("point.matrixTransform(point)"); 49 shouldThrow("point.matrixTransform(svgElement)"); 50 26 51 successfullyParsed = true; -
trunk/WebCore/Android.jscbindings.mk
r71515 r71802 147 147 bindings/js/JSSVGElementInstanceCustom.cpp \ 148 148 bindings/js/JSSVGLengthCustom.cpp \ 149 bindings/js/JSSVGMatrixCustom.cpp \150 149 bindings/js/JSSVGPathSegCustom.cpp \ 151 150 bindings/js/JSSVGPathSegListCustom.cpp \ -
trunk/WebCore/Android.v8bindings.mk
r71515 r71802 156 156 bindings/v8/custom/V8SVGElementCustom.cpp \ 157 157 bindings/v8/custom/V8SVGLengthCustom.cpp \ 158 bindings/v8/custom/V8SVGMatrixCustom.cpp159 158 bindings/v8/custom/V8SVGPathSegCustom.cpp \ 160 159 endif -
trunk/WebCore/CMakeLists.txt
r71711 r71802 1716 1716 bindings/js/JSSVGElementInstanceCustom.cpp 1717 1717 bindings/js/JSSVGLengthCustom.cpp 1718 bindings/js/JSSVGMatrixCustom.cpp1719 1718 bindings/js/JSSVGPathSegCustom.cpp 1720 1719 bindings/js/JSSVGPathSegListCustom.cpp -
trunk/WebCore/ChangeLog
r71801 r71802 1 2010-11-10 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Convert SVGMatrix/SVGTransform/SVGTransformList to the new SVGPropertyTearOff concept 6 https://bugs.webkit.org/show_bug.cgi?id=49311 7 8 Move the last list type, SVGTransformList, and the last POD types, SVGMatrix & SVGTransform, over to the new SVGPropertyTearOff concept. 9 Removes the need for a custom JSSVGMatrix/V8SVGMatrix implementation, it's all integrated within the bindings now. 10 11 Tests: svg/W3C-SVG-1.1-SE/coords-dom-01-f.svg 12 svg/W3C-SVG-1.1-SE/coords-dom-02-f.svg 13 svg/W3C-SVG-1.1-SE/coords-dom-03-f.svg 14 svg/W3C-SVG-1.1-SE/coords-dom-04-f.svg 15 svg/W3C-SVG-1.1-SE/types-dom-01-b.svg 16 svg/W3C-SVG-1.1-SE/types-dom-02-f.svg 17 svg/W3C-SVG-1.1-SE/types-dom-03-b.svg 18 svg/W3C-SVG-1.1-SE/types-dom-04-b.svg 19 svg/W3C-SVG-1.1-SE/types-dom-05-b.svg 20 svg/dom/SVGMatrix.html 21 svg/dom/SVGTransform.html 22 svg/dom/SVGTransformList.html 23 24 * Android.jscbindings.mk: Removed JSSVGMatrixCustom.cpp. 25 * Android.v8bindings.mk: Removed V8SVGMatrixCustom.cpp. 26 * CMakeLists.txt: Remove JSSVGMatrixCustom.cpp. 27 * GNUmakefile.am: Ditto. Add SVGAnimatedTransformListPropertyTearOff.h/SVGStaticPropertyWithParentTearOff.h/SVGTransformListPropertyTearOff.h/SVGAnimatedTransformList.h/SVGMatrix.h to build. 28 * WebCore.gypi: Ditto. 29 * WebCore.pro: Ditto. 30 * WebCore.vcproj/WebCore.vcproj: Ditto. 31 * WebCore.xcodeproj/project.pbxproj: Ditto. 32 * bindings/js/JSBindingsAllInOne.cpp: Remove JSSVGMatrixCustom.cpp 33 * bindings/js/JSSVGMatrixCustom.cpp: Removed. 34 * bindings/scripts/CodeGenerator.pm: Convert SVGMatrix/SVGTransform/SVGTransformList to the new concept. 35 * bindings/scripts/CodeGeneratorJS.pm: Ditto. 36 * bindings/scripts/CodeGeneratorObjC.pm: Ditto. 37 * bindings/scripts/CodeGeneratorV8.pm: Ditto. 38 * bindings/v8/custom/V8SVGMatrixCustom.cpp: Removed. 39 * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGTransformList handling. 40 * svg/DeprecatedSVGAnimatedTemplate.h: Ditto. 41 * svg/SVGAnimateTransformElement.cpp: Adapt to SVGTransformList API changes. 42 (WebCore::transformListFor): 43 (WebCore::SVGAnimateTransformElement::resetToBaseValue): 44 (WebCore::SVGAnimateTransformElement::calculateAnimatedValue): 45 (WebCore::SVGAnimateTransformElement::applyResultsToTarget): 46 * svg/SVGAnimatedTransformList.h: Added. 47 * svg/SVGGradientElement.cpp: Ditto. 48 (WebCore::SVGGradientElement::SVGGradientElement): 49 (WebCore::SVGGradientElement::parseMappedAttribute): 50 * svg/SVGGradientElement.h: Ditto. 51 * svg/SVGLinearGradientElement.cpp: Ditto. 52 (WebCore::SVGLinearGradientElement::collectGradientAttributes): 53 * svg/SVGMatrix.h: Added. SVGMatrix inherits from AffineTransform, and is only used in the bindings. It implements SVGs special requirements. 54 (WebCore::SVGMatrix::translate): Returns a copy of the matrix, not affecting the original matrix. 55 (WebCore::SVGMatrix::scale): Ditto. 56 (WebCore::SVGMatrix::scaleNonUniform): Ditto. 57 (WebCore::SVGMatrix::rotate): Ditto. 58 (WebCore::SVGMatrix::flipX): Ditto. 59 (WebCore::SVGMatrix::flipY): Ditto. 60 (WebCore::SVGMatrix::skewX): Ditto. 61 (WebCore::SVGMatrix::skewY): Ditto. 62 (WebCore::SVGMatrix::multiply): Ditto. 63 (WebCore::SVGMatrix::inverse): Ditto. 64 (WebCore::SVGMatrix::rotateFromVector): Dittto. 65 * svg/SVGMatrix.idl: Enable StrictTypeChecking/RequiresAllArguments=Raise on all attributes/functions. 66 * svg/SVGPatternElement.cpp: Adapt to SVGTransformList API changes. 67 (WebCore::SVGPatternElement::SVGPatternElement): 68 (WebCore::SVGPatternElement::parseMappedAttribute): 69 (WebCore::SVGPatternElement::collectPatternAttributes): 70 * svg/SVGPatternElement.h: Ditto. 71 * svg/SVGPoint.idl: Enable StrictTypeChecking/RequiresAllArguments=Raise for 'matrixTransform', now that SVGMatrix has been converted to the new scheme. 72 * svg/SVGRadialGradientElement.cpp: Adapt to SVGTransformList API changes. 73 (WebCore::SVGRadialGradientElement::collectGradientAttributes): 74 * svg/SVGSVGElement.cpp: Ditto. 75 (WebCore::SVGSVGElement::createSVGTransformFromMatrix): 76 (WebCore::SVGSVGElement::viewBoxToViewTransform): 77 * svg/SVGSVGElement.h: Ditto. 78 * svg/SVGStyledTransformableElement.cpp: Ditto. 79 (WebCore::SVGStyledTransformableElement::SVGStyledTransformableElement): 80 (WebCore::SVGStyledTransformableElement::animatedLocalTransform): 81 (WebCore::SVGStyledTransformableElement::parseMappedAttribute): 82 * svg/SVGStyledTransformableElement.h: Ditto. 83 * svg/SVGTextElement.cpp: Ditto. 84 (WebCore::SVGTextElement::SVGTextElement): 85 (WebCore::SVGTextElement::parseMappedAttribute): 86 (WebCore::SVGTextElement::animatedLocalTransform): 87 * svg/SVGTextElement.h: Ditto. 88 * svg/SVGTransform.cpp: Modernize code, inlined some getters. 89 (WebCore::SVGTransform::SVGTransform): 90 (WebCore::SVGTransform::setMatrix): 91 * svg/SVGTransform.h: Reindent header. 92 (WebCore::SVGTransform::type): 93 (WebCore::SVGTransform::svgMatrix): 94 (WebCore::SVGTransform::matrix): 95 (WebCore::SVGTransform::angle): 96 (WebCore::SVGTransform::rotationCenter): 97 (WebCore::SVGTransform::isValid): 98 (WebCore::operator==): Avoid function calls, make operator== a friend of SVGTransform, and compare members directly. 99 (WebCore::operator!=): 100 * svg/SVGTransform.idl: 101 * svg/SVGTransformList.cpp: Rewritten as plain Vector<SVGTransform>. 102 (WebCore::SVGTransformList::createSVGTransformFromMatrix): 103 (WebCore::SVGTransformList::consolidate): 104 (WebCore::SVGTransformList::concatenate): 105 (WebCore::SVGTransformList::valueAsString): 106 * svg/SVGTransformList.h: 107 (WebCore::SVGTransformList::SVGTransformList): 108 * svg/SVGTransformList.idl: Enable StrictTypeChecking/RequiresAllArguments=Raise on all attributes/functions. 109 * svg/SVGTransformable.cpp: Adapt to SVGTransformList API changes. 110 (WebCore::SVGTransformable::parseTransformAttribute): 111 * svg/SVGTransformable.h: Ditto. 112 * svg/SVGViewSpec.cpp: Ditto. 113 (WebCore::SVGViewSpec::SVGViewSpec): 114 (WebCore::SVGViewSpec::setTransform): 115 (WebCore::SVGViewSpec::parseViewSpec): 116 * svg/SVGViewSpec.h: Ditto. 117 (WebCore::SVGViewSpec::transform): 118 * svg/properties/SVGAnimatedListPropertyTearOff.h: Made constructor and members protected. 119 * svg/properties/SVGAnimatedPropertyMacros.h: Add new helper macro DECLARE_ANIMATED_TRANSFORM_LIST_PROPERTY. This is needed until we expand all macros. 120 * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Added. Extends SVGAnimatedListPropertyTearOff, returning SVGTransformListPropertyTearOff objects. 121 (WebCore::SVGAnimatedTransformListPropertyTearOff::baseVal): 122 (WebCore::SVGAnimatedTransformListPropertyTearOff::animVal): 123 (WebCore::SVGAnimatedTransformListPropertyTearOff::create): 124 (WebCore::SVGAnimatedTransformListPropertyTearOff::SVGAnimatedTransformListPropertyTearOff): 125 * svg/properties/SVGListPropertyTearOff.h: Made construct and members protected. 126 * svg/properties/SVGProperty.h: Declare commitChange() as pure virtual method. 127 * svg/properties/SVGPropertyTraits.h: Handle SVGTransformList. 128 * svg/properties/SVGStaticPropertyWithParentTearOff.h: Added. Same concept as JSSVGStaticPODTypeWrapperWithParent, used to expose SVGPropertyTearOffs for types 129 that are using this concept themselves. (SVGMatrix attribute of SVGTransform, both are POD types, using SVGPropertyTearOff). 130 (WebCore::SVGStaticPropertyWithParentTearOff::create): 131 (WebCore::SVGStaticPropertyWithParentTearOff::commitChange): 132 (WebCore::SVGStaticPropertyWithParentTearOff::SVGStaticPropertyWithParentTearOff): 133 * svg/properties/SVGTransformListPropertyTearOff.h: Added. Extends SVGListPropertyTearOff by two special SVGTransformList methods: consolidate and createSVGTransformFromMatrix. 134 (WebCore::SVGTransformListPropertyTearOff::create): 135 (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix): 136 (WebCore::SVGTransformListPropertyTearOff::consolidate): 137 (WebCore::SVGTransformListPropertyTearOff::SVGTransformListPropertyTearOff): 138 1 139 2010-11-11 Alejandro G. Castro <alex@igalia.com> 2 140 -
trunk/WebCore/GNUmakefile.am
r71791 r71802 799 799 WebCore/bindings/js/JSSVGElementInstanceCustom.cpp \ 800 800 WebCore/bindings/js/JSSVGLengthCustom.cpp \ 801 WebCore/bindings/js/JSSVGMatrixCustom.cpp \802 801 WebCore/bindings/js/JSSVGPathSegCustom.cpp \ 803 802 WebCore/bindings/js/JSSVGPathSegListCustom.cpp \ … … 3061 3060 WebCore/svg/properties/SVGAnimatedPropertyTearOff.h \ 3062 3061 WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h \ 3062 WebCore/svg/properties/SVGAnimatedTransformListPropertyTearOff.h \ 3063 3063 WebCore/svg/properties/SVGListProperty.h \ 3064 3064 WebCore/svg/properties/SVGListPropertyTearOff.h \ … … 3068 3068 WebCore/svg/properties/SVGStaticListPropertyTearOff.h \ 3069 3069 WebCore/svg/properties/SVGStaticPropertyTearOff.h \ 3070 WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h \ 3071 WebCore/svg/properties/SVGTransformListPropertyTearOff.h \ 3070 3072 WebCore/svg/RadialGradientAttributes.h \ 3071 3073 WebCore/svg/SVGAElement.cpp \ … … 3090 3092 WebCore/svg/SVGAnimatedRect.h \ 3091 3093 WebCore/svg/SVGAnimatedString.h \ 3094 WebCore/svg/SVGAnimatedTransformList.h \ 3092 3095 WebCore/svg/SVGAnimateElement.cpp \ 3093 3096 WebCore/svg/SVGAnimateElement.h \ … … 3232 3235 WebCore/svg/SVGMaskElement.cpp \ 3233 3236 WebCore/svg/SVGMaskElement.h \ 3237 WebCore/svg/SVGMatrix.h \ 3234 3238 WebCore/svg/SVGMetadataElement.cpp \ 3235 3239 WebCore/svg/SVGMetadataElement.h \ -
trunk/WebCore/WebCore.gypi
r71711 r71802 678 678 'bindings/js/JSSVGElementInstanceCustom.cpp', 679 679 'bindings/js/JSSVGLengthCustom.cpp', 680 'bindings/js/JSSVGMatrixCustom.cpp',681 680 'bindings/js/JSSVGPathSegCustom.cpp', 682 681 'bindings/js/JSSVGPathSegListCustom.cpp', … … 838 837 'bindings/v8/custom/V8SVGElementCustom.cpp', 839 838 'bindings/v8/custom/V8SVGLengthCustom.cpp', 840 'bindings/v8/custom/V8SVGMatrixCustom.cpp',841 839 'bindings/v8/custom/V8SVGPathSegCustom.cpp', 842 840 'bindings/v8/custom/V8SharedWorkerCustom.cpp', … … 3975 3973 'svg/properties/SVGAnimatedPropertyTearOff.h', 3976 3974 'svg/properties/SVGAnimatedStaticPropertyTearOff.h', 3975 'svg/properties/SVGAnimatedTransformListPropertyTearOff.h', 3977 3976 'svg/properties/SVGListProperty.h', 3978 3977 'svg/properties/SVGListPropertyTearOff.h', … … 3982 3981 'svg/properties/SVGStaticListPropertyTearOff.h', 3983 3982 'svg/properties/SVGStaticPropertyTearOff.h', 3983 'svg/properties/SVGStaticPropertyWithParentTearOff.h', 3984 'svg/properties/SVGTransformListPropertyTearOff.h', 3984 3985 'svg/ColorDistance.cpp', 3985 3986 'svg/ColorDistance.h', … … 4020 4021 'svg/SVGAnimatedRect.h', 4021 4022 'svg/SVGAnimatedString.h', 4023 'svg/SVGAnimatedTransformList.h', 4022 4024 'svg/SVGAnimationElement.cpp', 4023 4025 'svg/SVGAnimationElement.h', … … 4158 4160 'svg/SVGMaskElement.cpp', 4159 4161 'svg/SVGMaskElement.h', 4162 'svg/SVGMatrix.h', 4160 4163 'svg/SVGMetadataElement.cpp', 4161 4164 'svg/SVGMetadataElement.h', -
trunk/WebCore/WebCore.pro
r71711 r71802 472 472 bindings/v8/custom/V8SVGElementCustom.cpp \ 473 473 bindings/v8/custom/V8SVGLengthCustom.cpp \ 474 bindings/v8/custom/V8SVGMatrixCustom.cpp \475 474 bindings/v8/custom/V8SVGPathSegCustom.cpp \ 476 475 \ … … 2372 2371 svg/properties/SVGAnimatedPropertyTearOff.h \ 2373 2372 svg/properties/SVGAnimatedStaticPropertyTearOff.h \ 2373 svg/properties/SVGAnimatedTransformListPropertyTearOff.h \ 2374 2374 svg/properties/SVGListProperty.h \ 2375 2375 svg/properties/SVGListPropertyTearOff.h \ … … 2379 2379 svg/properties/SVGStaticListPropertyTearOff.h \ 2380 2380 svg/properties/SVGStaticPropertyTearOff.h \ 2381 svg/properties/SVGStaticPropertyWithParentTearOff.h \ 2382 svg/properties/SVGTransformListPropertyTearOff.h \ 2381 2383 svg/SVGAElement.h \ 2382 2384 svg/SVGAltGlyphElement.h \ … … 2395 2397 svg/SVGAnimatedRect.h \ 2396 2398 svg/SVGAnimatedString.h \ 2399 svg/SVGAnimatedTransformList.h \ 2397 2400 svg/SVGAnimateElement.h \ 2398 2401 svg/SVGAnimateMotionElement.h \ … … 2464 2467 svg/SVGMarkerElement.h \ 2465 2468 svg/SVGMaskElement.h \ 2469 svg/SVGMatrix.h \ 2466 2470 svg/SVGMetadataElement.h \ 2467 2471 svg/SVGMissingGlyphElement.h \ … … 3370 3374 bindings/js/JSSVGElementInstanceCustom.cpp \ 3371 3375 bindings/js/JSSVGLengthCustom.cpp \ 3372 bindings/js/JSSVGMatrixCustom.cpp \3373 3376 bindings/js/JSSVGPathSegCustom.cpp \ 3374 3377 bindings/js/JSSVGPathSegListCustom.cpp -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r71711 r71802 60252 60252 </File> 60253 60253 <File 60254 RelativePath="..\bindings\js\JSSVGMatrixCustom.cpp"60255 >60256 <FileConfiguration60257 Name="Debug|Win32"60258 ExcludedFromBuild="true"60259 >60260 <Tool60261 Name="VCCLCompilerTool"60262 />60263 </FileConfiguration>60264 <FileConfiguration60265 Name="Release|Win32"60266 ExcludedFromBuild="true"60267 >60268 <Tool60269 Name="VCCLCompilerTool"60270 />60271 </FileConfiguration>60272 <FileConfiguration60273 Name="Debug_Internal|Win32"60274 ExcludedFromBuild="true"60275 >60276 <Tool60277 Name="VCCLCompilerTool"60278 />60279 </FileConfiguration>60280 <FileConfiguration60281 Name="Debug_Cairo|Win32"60282 ExcludedFromBuild="true"60283 >60284 <Tool60285 Name="VCCLCompilerTool"60286 />60287 </FileConfiguration>60288 <FileConfiguration60289 Name="Release_Cairo|Win32"60290 ExcludedFromBuild="true"60291 >60292 <Tool60293 Name="VCCLCompilerTool"60294 />60295 </FileConfiguration>60296 <FileConfiguration60297 Name="Debug_All|Win32"60298 ExcludedFromBuild="true"60299 >60300 <Tool60301 Name="VCCLCompilerTool"60302 />60303 </FileConfiguration>60304 </File>60305 <File60306 60254 RelativePath="..\bindings\js\JSSVGPathSegCustom.cpp" 60307 60255 > … … 61885 61833 </File> 61886 61834 <File 61835 RelativePath="..\svg\SVGAnimatedTransformList.h" 61836 > 61837 </File> 61838 <File 61887 61839 RelativePath="..\svg\SVGAnimateElement.h" 61888 61840 > … … 62378 62330 <File 62379 62331 RelativePath="..\svg\SVGMaskElement.h" 62332 > 62333 </File> 62334 <File 62335 RelativePath="..\svg\SVGMatrix.h" 62380 62336 > 62381 62337 </File> … … 62932 62888 </File> 62933 62889 <File 62890 RelativePath="..\svg\properties\SVGAnimatedTransformListPropertyTearOff.h" 62891 > 62892 </File> 62893 <File 62934 62894 RelativePath="..\svg\properties\SVGListProperty.h" 62935 62895 > … … 62957 62917 <File 62958 62918 RelativePath="..\svg\properties\SVGStaticPropertyTearOff.h" 62919 > 62920 </File> 62921 <File 62922 RelativePath="..\svg\properties\SVGStaticPropertyWithParentTearOff.h" 62923 > 62924 </File> 62925 <File 62926 RelativePath="..\svg\properties\SVGTransformListPropertyTearOff.h" 62959 62927 > 62960 62928 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r71711 r71802 61 61 0804BF6E0EE09C3B0006C000 /* WMLDoElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0804BF6C0EE09C3B0006C000 /* WMLDoElement.cpp */; }; 62 62 0804BF6F0EE09C3B0006C000 /* WMLDoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0804BF6D0EE09C3B0006C000 /* WMLDoElement.h */; }; 63 0806E57A12893045007CED32 /* SVGMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 0806E57912893045007CED32 /* SVGMatrix.h */; settings = {ATTRIBUTES = (Private, ); }; }; 63 64 08082373117987C100241DE8 /* RenderSVGResourceContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 08082372117987C100241DE8 /* RenderSVGResourceContainer.h */; }; 64 65 080AEC810ED8708B00DF4CCE /* WMLIntrinsicEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 080AEC7D0ED8708A00DF4CCE /* WMLIntrinsicEvent.cpp */; }; … … 96 97 082341C60FCF3A9500D75BD6 /* WMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */; }; 97 98 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */; settings = {ATTRIBUTES = (Private, ); }; }; 99 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 98 100 082FCAC4110927CE00CC4821 /* JSSVGContextCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 99 101 083192AA112B43050083C3B9 /* RenderSVGResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 083192A7112B43050083C3B9 /* RenderSVGResource.h */; }; … … 144 146 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */; settings = {ATTRIBUTES = (Private, ); }; }; 145 147 08591AA50F085C4E009BACB1 /* InputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08591AA40F085C4E009BACB1 /* InputElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 148 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 146 149 085AFDC80F2977350061F2B3 /* WMLFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */; }; 147 150 085AFDC90F2977350061F2B3 /* WMLFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */; settings = {ATTRIBUTES = (); }; }; … … 235 238 08C6A7AB117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C6A7A9117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp */; }; 236 239 08C6A7AC117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */; }; 240 08C7136E128956A3001B107E /* SVGTransformListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C7136D128956A3001B107E /* SVGTransformListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 237 241 08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; }; 238 242 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C859BF1274575300A5728D /* SVGAnimatedRect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 239 243 08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */; }; 240 244 08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C925180FCC7C4A00480DEC /* FilterEffect.h */; }; 245 08CA3D4412894A3800FFF260 /* SVGStaticPropertyWithParentTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08CA3D4312894A3800FFF260 /* SVGStaticPropertyWithParentTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 241 246 08CD61BC0ED3929C002DDF51 /* WMLTaskElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08CD61B80ED3929C002DDF51 /* WMLTaskElement.cpp */; }; 242 247 08CD61BD0ED3929C002DDF51 /* WMLTaskElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08CD61B90ED3929C002DDF51 /* WMLTaskElement.h */; }; … … 4227 4232 B25599A40D00D8BA00BB825C /* SVGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990C0D00D8B900BB825C /* SVGImage.h */; }; 4228 4233 B25599A50D00D8BA00BB825C /* EmptyClients.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990D0D00D8B900BB825C /* EmptyClients.h */; }; 4229 B25DFAAF0B2E2929000E6510 /* JSSVGMatrixCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */; };4230 4234 B262B8040D1F32D000158F09 /* SVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B262B8030D1F32D000158F09 /* SVGFont.cpp */; }; 4231 4235 B266CD4D0C3AEC6500EB08D2 /* JSSVGException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B266CD4B0C3AEC6500EB08D2 /* JSSVGException.cpp */; }; … … 6110 6114 0804BF6C0EE09C3B0006C000 /* WMLDoElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLDoElement.cpp; sourceTree = "<group>"; }; 6111 6115 0804BF6D0EE09C3B0006C000 /* WMLDoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLDoElement.h; sourceTree = "<group>"; }; 6116 0806E57912893045007CED32 /* SVGMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMatrix.h; sourceTree = "<group>"; }; 6112 6117 08082372117987C100241DE8 /* RenderSVGResourceContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceContainer.h; sourceTree = "<group>"; }; 6113 6118 080AEC7D0ED8708A00DF4CCE /* WMLIntrinsicEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLIntrinsicEvent.cpp; sourceTree = "<group>"; }; … … 6145 6150 082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLSelectElement.h; sourceTree = "<group>"; }; 6146 6151 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedInteger.h; sourceTree = "<group>"; }; 6152 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformList.h; sourceTree = "<group>"; }; 6147 6153 082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGContextCache.h; sourceTree = "<group>"; }; 6148 6154 083192A7112B43050083C3B9 /* RenderSVGResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResource.h; sourceTree = "<group>"; }; … … 6191 6197 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedBoolean.h; sourceTree = "<group>"; }; 6192 6198 08591AA40F085C4E009BACB1 /* InputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputElement.h; sourceTree = "<group>"; }; 6199 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformListPropertyTearOff.h; sourceTree = "<group>"; }; 6193 6200 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFormControlElement.cpp; sourceTree = "<group>"; }; 6194 6201 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFormControlElement.h; sourceTree = "<group>"; }; … … 6270 6277 08C6A7A9117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceSolidColor.cpp; sourceTree = "<group>"; }; 6271 6278 08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceSolidColor.h; sourceTree = "<group>"; }; 6279 08C7136D128956A3001B107E /* SVGTransformListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformListPropertyTearOff.h; sourceTree = "<group>"; }; 6272 6280 08C859BF1274575300A5728D /* SVGAnimatedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedRect.h; sourceTree = "<group>"; }; 6273 6281 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FilterEffect.cpp; path = filters/FilterEffect.cpp; sourceTree = "<group>"; }; 6274 6282 08C925180FCC7C4A00480DEC /* FilterEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FilterEffect.h; path = filters/FilterEffect.h; sourceTree = "<group>"; }; 6283 08CA3D4312894A3800FFF260 /* SVGStaticPropertyWithParentTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStaticPropertyWithParentTearOff.h; sourceTree = "<group>"; }; 6275 6284 08CD61B80ED3929C002DDF51 /* WMLTaskElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLTaskElement.cpp; sourceTree = "<group>"; }; 6276 6285 08CD61B90ED3929C002DDF51 /* WMLTaskElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLTaskElement.h; sourceTree = "<group>"; }; … … 10229 10238 B255990C0D00D8B900BB825C /* SVGImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGImage.h; sourceTree = "<group>"; }; 10230 10239 B255990D0D00D8B900BB825C /* EmptyClients.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EmptyClients.h; sourceTree = "<group>"; }; 10231 B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGMatrixCustom.cpp; sourceTree = "<group>"; };10232 10240 B262B8030D1F32D000158F09 /* SVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFont.cpp; sourceTree = "<group>"; }; 10233 10241 B266CD4B0C3AEC6500EB08D2 /* JSSVGException.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGException.cpp; sourceTree = "<group>"; }; … … 11802 11810 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */, 11803 11811 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */, 11812 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */, 11804 11813 0810764312828556007C63BA /* SVGListProperty.h */, 11805 11814 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */, … … 11809 11818 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */, 11810 11819 0813A4E91284132600992511 /* SVGStaticPropertyTearOff.h */, 11820 08CA3D4312894A3800FFF260 /* SVGStaticPropertyWithParentTearOff.h */, 11821 08C7136D128956A3001B107E /* SVGTransformListPropertyTearOff.h */, 11811 11822 ); 11812 11823 path = properties; … … 14546 14557 4F1534DD11B532EC0021FD86 /* EditingBehavior.h */, 14547 14558 4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */, 14559 9BAB6C6B12550631001626D4 /* EditingStyle.cpp */, 14548 14560 9BAB6C6A12550631001626D4 /* EditingStyle.h */, 14549 9BAB6C6B12550631001626D4 /* EditingStyle.cpp */,14550 14561 4B3043CA0AE0373B00A82647 /* Editor.cpp */, 14551 14562 4B3043CB0AE0373B00A82647 /* Editor.h */, … … 16137 16148 084DB59A128008CC002A6D64 /* SVGAnimatedString.h */, 16138 16149 B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */, 16150 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */, 16139 16151 B22277F80D00BF1F0071B782 /* SVGAnimatedTransformList.idl */, 16140 16152 B22277F90D00BF1F0071B782 /* SVGAnimateElement.cpp */, … … 16345 16357 B22278B10D00BF200071B782 /* SVGMaskElement.h */, 16346 16358 B22278B20D00BF200071B782 /* SVGMaskElement.idl */, 16359 0806E57912893045007CED32 /* SVGMatrix.h */, 16347 16360 B22278B30D00BF200071B782 /* SVGMatrix.idl */, 16348 16361 B22278B40D00BF200071B782 /* SVGMetadataElement.cpp */, … … 17138 17151 08A48A6D0E86CF6D00E225DD /* JSSVGElementInstanceCustom.cpp */, 17139 17152 08E4FE450E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp */, 17140 B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */,17141 17153 B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */, 17142 17154 B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */, … … 17286 17298 isa = PBXGroup; 17287 17299 children = ( 17288 A8D2B2521287A56000AF4DDA /* cache */,17289 17300 1A8F6BB00DB55CDC001DB794 /* appcache */, 17290 17301 512DD8E80D91E691000F89EE /* archive */, 17302 A8D2B2521287A56000AF4DDA /* cache */, 17291 17303 5126E6B60A2E3AEF005C29FA /* icon */, 17292 17304 93A1EAA20A5634D8006960A0 /* mac */, … … 18581 18593 1A569CFC0D7E2B82007C3983 /* c_runtime.h in Headers */, 18582 18594 1A569CFE0D7E2B82007C3983 /* c_utility.h in Headers */, 18583 BCB16C180979C3BD00467741 /* MemoryCache.h in Headers */,18584 18595 BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */, 18585 18596 BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */, … … 19630 19641 976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */, 19631 19642 893C47A81238908B002B3D86 /* FileWriterCallback.h in Headers */, 19643 46700ED1127B96CB00F5D5D6 /* FileWriterSync.h in Headers */, 19632 19644 BC5EB69F0E81DAEB00B25965 /* FillLayer.h in Headers */, 19633 19645 845E72F80FD261EE00A87D79 /* Filter.h in Headers */, … … 20457 20469 4E19592C0A39DACC00220FE5 /* MediaQueryEvaluator.h in Headers */, 20458 20470 4E19592E0A39DACC00220FE5 /* MediaQueryExp.h in Headers */, 20471 BCB16C180979C3BD00467741 /* MemoryCache.h in Headers */, 20459 20472 9FFE3E7B11B59C5D0037874E /* MemoryInfo.h in Headers */, 20460 20473 93309DFA099E64920056E581 /* MergeIdenticalElementsCommand.h in Headers */, … … 20748 20761 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */, 20749 20762 BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */, 20763 A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */, 20750 20764 F39BE95C12673BF400E0A674 /* ScriptArguments.h in Headers */, 20751 A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */,20752 20765 7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */, 20753 20766 41F1D21F0EF35C2A00DA8753 /* ScriptCachedFrameData.h in Headers */, … … 20927 20940 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */, 20928 20941 084DB59B128008CC002A6D64 /* SVGAnimatedString.h in Headers */, 20942 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */, 20929 20943 B22279900D00BF220071B782 /* SVGAnimateElement.h in Headers */, 20930 20944 B22279930D00BF220071B782 /* SVGAnimateMotionElement.h in Headers */, … … 21012 21026 08735FB910E91232006D6FAD /* SVGMarkerLayoutInfo.h in Headers */, 21013 21027 B2227A470D00BF220071B782 /* SVGMaskElement.h in Headers */, 21028 0806E57A12893045007CED32 /* SVGMatrix.h in Headers */, 21014 21029 B2227A4B0D00BF220071B782 /* SVGMetadataElement.h in Headers */, 21015 21030 B2A1F2B10CEF0ABF00442F6A /* SVGMissingGlyphElement.h in Headers */, … … 21071 21086 0880F70E1282B46D00948505 /* SVGStaticListPropertyTearOff.h in Headers */, 21072 21087 0813A4EA1284132600992511 /* SVGStaticPropertyTearOff.h in Headers */, 21088 08CA3D4412894A3800FFF260 /* SVGStaticPropertyWithParentTearOff.h in Headers */, 21073 21089 B2227AA90D00BF220071B782 /* SVGStopElement.h in Headers */, 21074 21090 B2227AAC0D00BF220071B782 /* SVGStringList.h in Headers */, … … 21101 21117 B2227ADD0D00BF220071B782 /* SVGTransformDistance.h in Headers */, 21102 21118 B2227ADF0D00BF220071B782 /* SVGTransformList.h in Headers */, 21119 08C7136E128956A3001B107E /* SVGTransformListPropertyTearOff.h in Headers */, 21103 21120 B2227AE20D00BF220071B782 /* SVGTRefElement.h in Headers */, 21104 21121 B2227AE50D00BF220071B782 /* SVGTSpanElement.h in Headers */, … … 21345 21362 E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */, 21346 21363 97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */, 21347 46700ED1127B96CB00F5D5D6 /* FileWriterSync.h in Headers */,21364 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */, 21348 21365 ); 21349 21366 runOnlyForDeploymentPostprocessing = 0; … … 21405 21422 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 21406 21423 compatibilityVersion = "Xcode 2.4"; 21407 developmentRegion = English;21408 21424 hasScannedForEncodings = 1; 21409 21425 knownRegions = ( … … 21734 21750 1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */, 21735 21751 1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */, 21736 BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */,21737 21752 BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */, 21738 21753 BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */, … … 22269 22284 976D6C8D122B8A3D001FD1F7 /* FileThread.cpp in Sources */, 22270 22285 976D6C90122B8A3D001FD1F7 /* FileWriter.cpp in Sources */, 22286 46700ED0127B96CB00F5D5D6 /* FileWriterSync.cpp in Sources */, 22271 22287 BC5EB69E0E81DAEB00B25965 /* FillLayer.cpp in Sources */, 22272 22288 08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */, … … 22984 23000 B2FA3DAA0AB75A6F000E5AC4 /* JSSVGMaskElement.cpp in Sources */, 22985 23001 B2FA3DAC0AB75A6F000E5AC4 /* JSSVGMatrix.cpp in Sources */, 22986 B25DFAAF0B2E2929000E6510 /* JSSVGMatrixCustom.cpp in Sources */,22987 23002 B2FA3DAE0AB75A6F000E5AC4 /* JSSVGMetadataElement.cpp in Sources */, 22988 23003 B27B28290CEF0C0700D39D54 /* JSSVGMissingGlyphElement.cpp in Sources */, … … 23161 23176 4E19592B0A39DACC00220FE5 /* MediaQueryEvaluator.cpp in Sources */, 23162 23177 4E19592D0A39DACC00220FE5 /* MediaQueryExp.cpp in Sources */, 23178 BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */, 23163 23179 9FFE3E7A11B59C5D0037874E /* MemoryInfo.cpp in Sources */, 23164 23180 93309DF9099E64920056E581 /* MergeIdenticalElementsCommand.cpp in Sources */, … … 23385 23401 51AA3F6F0BD5AA9E00892971 /* ResourceLoaderMac.mm in Sources */, 23386 23402 973E325610883B7C005BC493 /* ResourceLoadNotifier.cpp in Sources */, 23403 D0CE58F8125E4CC200F3F199 /* ResourceLoadScheduler.cpp in Sources */, 23387 23404 514C767C0CE923A1007EF3CD /* ResourceRequestBase.cpp in Sources */, 23388 23405 514C76530CE9234E007EF3CD /* ResourceRequestMac.mm in Sources */, … … 23915 23932 E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */, 23916 23933 97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */, 23917 46700ED0127B96CB00F5D5D6 /* FileWriterSync.cpp in Sources */,23918 D0CE58F8125E4CC200F3F199 /* ResourceLoadScheduler.cpp in Sources */,23919 23934 ); 23920 23935 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/js/JSBindingsAllInOne.cpp
r71515 r71802 117 117 #include "JSSVGElementInstanceCustom.cpp" 118 118 #include "JSSVGLengthCustom.cpp" 119 #include "JSSVGMatrixCustom.cpp"120 119 #include "JSSVGPathSegCustom.cpp" 121 120 #include "JSSVGPathSegListCustom.cpp" -
trunk/WebCore/bindings/scripts/CodeGenerator.pm
r71512 r71802 51 51 my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1); 52 52 53 my %podTypeHash = ("SVGTransform" => 1);54 my %podTypesWithWritablePropertiesHash = ("SVGMatrix" => 1);55 53 my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1); 56 54 57 55 my %nonPointerTypeHash = ("DOMTimeStamp" => 1, "CompareHow" => 1, "SVGPaintType" => 1); 58 59 my %svgNewStyleAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1,60 "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" => 1,61 "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1,62 "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" => 1,63 "SVGAnimatedPreserveAspectRatio" => 1, "SVGAnimatedRect" => 1,64 "SVGAnimatedString" => 1);65 56 66 57 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, … … 82 73 "SVGLength" => "SVGPropertyTearOff<SVGLength>", 83 74 "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>", 75 "SVGMatrix" => "SVGPropertyTearOff<SVGMatrix>", 84 76 "SVGNumber" => "SVGPropertyTearOff<float>", 85 77 "SVGNumberList" => "SVGListPropertyTearOff<SVGNumberList>", … … 88 80 "SVGPreserveAspectRatio" => "SVGPropertyTearOff<SVGPreserveAspectRatio>", 89 81 "SVGRect" => "SVGPropertyTearOff<FloatRect>", 90 "SVGStringList" => "SVGStaticListPropertyTearOff<SVGStringList>" 82 "SVGStringList" => "SVGStaticListPropertyTearOff<SVGStringList>", 83 "SVGTransform" => "SVGPropertyTearOff<SVGTransform>", 84 "SVGTransformList" => "SVGTransformListPropertyTearOff" 91 85 ); 92 86 93 87 my %svgTypeWithWritablePropertiesNeedingTearOff = ( 94 "SVGPoint" => 1 88 "SVGPoint" => 1, 89 "SVGMatrix" => 1 95 90 ); 96 91 … … 313 308 my $type = shift; 314 309 315 # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist. 316 return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix"; 317 return 0; 318 } 319 320 # FIXME: This method will go away once all SVG animated properties are converted to the new scheme. 321 sub IsPodType 322 { 323 my $object = shift; 324 my $type = shift; 325 326 return 1 if $podTypeHash{$type}; 327 return 1 if $podTypesWithWritablePropertiesHash{$type}; 328 return 0; 329 } 330 331 sub IsPodTypeWithWriteableProperties 332 { 333 my $object = shift; 334 my $type = shift; 335 336 return 1 if $podTypesWithWritablePropertiesHash{$type}; 310 # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h do not exist. 311 return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber"; 337 312 return 0; 338 313 } … … 416 391 } elsif ($svgTypeNeedingTearOff =~ /SVGStaticListPropertyTearOff/) { 417 392 $svgTypeNeedingTearOff =~ s/SVGStaticListPropertyTearOff<//; 418 } 393 } elsif ($svgTypeNeedingTearOff =~ /SVGTransformListPropertyTearOff/) { 394 $svgTypeNeedingTearOff =~ s/SVGTransformListPropertyTearOff<//; 395 } 419 396 420 397 $svgTypeNeedingTearOff =~ s/>//; 421 398 return $svgTypeNeedingTearOff; 422 }423 424 # FIXME: This method will go away once all SVG animated properties are converted to the new scheme.425 sub IsSVGNewStyleAnimatedType426 {427 my $object = shift;428 my $type = shift;429 430 return 1 if $svgNewStyleAnimatedTypeHash{$type};431 return 0;432 399 } 433 400 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r71515 r71802 326 326 return 0 unless $implClassName =~ /SVG/; 327 327 return 0 if $implClassName =~ /Element/; 328 return 0 if $codeGenerator->IsSVG NewStyleAnimatedType($implClassName);328 return 0 if $codeGenerator->IsSVGAnimatedType($implClassName); 329 329 return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); 330 330 … … 673 673 $implType = $svgNativeType if $svgNativeType; 674 674 675 # FIXME: Old style SVG JS bindings, will vanish soon. 676 my $podType = $dataNode->extendedAttributes->{"PODType"}; 677 if ($podType) { 678 $implType = "JSSVGPODTypeWrapper<$podType> "; 679 $headerIncludes{"$podType.h"} = 1 if $podType ne "float"; 680 $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1; 681 } 682 683 my $svgPropertyOrPodType; 684 $svgPropertyOrPodType = $podType if $podType; 685 $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType; 686 $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType; 675 my $svgPropertyOrListPropertyType; 676 $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType; 677 $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType; 687 678 688 679 my $numConstants = @{$dataNode->constants}; … … 692 683 push(@headerContent, "\nnamespace WebCore {\n\n"); 693 684 694 if ($codeGenerator->IsSVG NewStyleAnimatedType($implClassName)) {685 if ($codeGenerator->IsSVGAnimatedType($implClassName)) { 695 686 $headerIncludes{"$implClassName.h"} = 1; 696 687 } else { 697 688 # Implementation class forward declaration 698 AddClassForwardIfNeeded($implClassName) unless $svgPropertyOr PodType;689 AddClassForwardIfNeeded($implClassName) unless $svgPropertyOrListPropertyType; 699 690 } 700 691 … … 945 936 946 937 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"} || $dataNode->extendedAttributes->{"CustomToJS"}) { 947 if ($podType) { 948 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement*);\n"); 949 } elsif ($svgPropertyType) { 938 if ($svgPropertyType) { 950 939 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n"); 951 940 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { … … 956 945 } 957 946 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateNativeConverter"}) { 958 959 if ($podType) { 960 push(@headerContent, "$podType to${interfaceName}(JSC::JSValue);\n"); 961 } elsif ($interfaceName eq "NodeFilter") { 947 if ($interfaceName eq "NodeFilter") { 962 948 push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSValue);\n"); 963 949 } else { … … 1431 1417 $implType = $svgNativeType if $svgNativeType; 1432 1418 1433 my $podType = $dataNode->extendedAttributes->{"PODType"}; 1434 if ($podType) { 1435 $implType = "JSSVGPODTypeWrapper<$podType> "; 1436 } 1437 1438 my $svgPropertyOrPodType; 1439 $svgPropertyOrPodType = $podType if $podType; 1440 $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType; 1441 $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType; 1419 my $svgPropertyOrListPropertyType; 1420 $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType; 1421 $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType; 1442 1422 1443 1423 # Constructor … … 1562 1542 push(@implContent, " ${className}* castedThis = static_cast<$className*>(asObject(slotBase));\n"); 1563 1543 1564 my $implClassNameForValueConversion = "";1565 if (!$svgPropertyOrPodType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) {1566 $implClassNameForValueConversion = $implClassName;1567 }1568 1569 1544 if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} && 1570 1545 !$attribute->signature->extendedAttributes->{"DoNotCheckDomainSecurity"} && … … 1579 1554 $implIncludes{"JSDOMBinding.h"} = 1; 1580 1555 push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n"); 1581 push(@implContent, " return checkNodeSecurity(exec, imp->$implGetterFunctionName()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, $implClassNameForValueConversion,"imp->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");1556 push(@implContent, " return checkNodeSecurity(exec, imp->$implGetterFunctionName()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "imp->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n"); 1582 1557 } elsif ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) { 1583 1558 $implIncludes{"Document.h"} = 1; 1584 1559 $implIncludes{"JSDOMBinding.h"} = 1; 1585 1560 push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n"); 1586 push(@implContent, " return checkNodeSecurity(exec, imp->contentDocument()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, $implClassNameForValueConversion, "imp->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");1561 push(@implContent, " return checkNodeSecurity(exec, imp->contentDocument()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "imp->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n"); 1587 1562 } elsif ($type eq "EventListener") { 1588 1563 $implIncludes{"EventListener.h"} = 1; … … 1617 1592 1618 1593 if ($svgListPropertyType) { 1619 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "castedThis->impl()->$implGetterFunctionName()", "castedThis") . ";\n"); 1620 } elsif ($svgPropertyOrPodType) { 1621 push(@implContent, " $svgPropertyOrPodType imp(*castedThis->impl());\n") if $podType; 1622 push(@implContent, " $svgPropertyOrPodType& imp = castedThis->impl()->propertyReference();\n") if !$podType; 1623 if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber 1624 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp", "castedThis") . ";\n"); 1594 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "castedThis->impl()->$implGetterFunctionName()", "castedThis") . ";\n"); 1595 } elsif ($svgPropertyOrListPropertyType) { 1596 push(@implContent, " $svgPropertyOrListPropertyType& imp = castedThis->impl()->propertyReference();\n"); 1597 if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber 1598 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "imp", "castedThis") . ";\n"); 1625 1599 } else { 1626 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, " ", "imp.$implGetterFunctionName()", "castedThis") . ";\n");1600 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "imp.$implGetterFunctionName()", "castedThis") . ";\n"); 1627 1601 } 1628 1602 } else { 1629 1603 my $getterExpression = "imp->" . $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute) . ")"; 1630 my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, $ implClassNameForValueConversion, $getterExpression, "castedThis");1604 my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, $getterExpression, "castedThis"); 1631 1605 push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n"); 1632 1606 if ($codeGenerator->IsSVGAnimatedType($type)) { 1633 1607 push(@implContent, " RefPtr<$type> obj = $jsType;\n"); 1634 1635 if ($codeGenerator->IsSVGNewStyleAnimatedType($type)) { 1636 push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n"); 1637 } else { 1638 push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n"); 1639 } 1608 push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n"); 1640 1609 } else { 1641 1610 push(@implContent, " JSValue result = $jsType;\n"); … … 1648 1617 } else { 1649 1618 push(@implContent, " ExceptionCode ec = 0;\n"); 1650 if ($svgPropertyOr PodType) {1651 push(@implContent, " $svgPropertyOr PodType imp(*castedThis->impl());\n");1652 push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, " ", "imp.$implGetterFunctionName(ec)", "castedThis") . ";\n");1619 if ($svgPropertyOrListPropertyType) { 1620 push(@implContent, " $svgPropertyOrListPropertyType imp(*castedThis->impl());\n"); 1621 push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "imp.$implGetterFunctionName(ec)", "castedThis") . ";\n"); 1653 1622 } else { 1654 1623 push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n"); 1655 push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, $implClassNameForValueConversion,"imp->$implGetterFunctionName(ec)", "castedThis") . ";\n");1624 push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "imp->$implGetterFunctionName(ec)", "castedThis") . ";\n"); 1656 1625 } 1657 1626 … … 1813 1782 1814 1783 my $nativeValue = JSValueToNative($attribute->signature, "value"); 1815 if ($svgPropertyOrPodType) { 1816 push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType; 1817 push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType; 1818 if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber 1784 if ($svgPropertyOrListPropertyType) { 1785 push(@implContent, " $svgPropertyOrListPropertyType& podImp = imp->propertyReference();\n"); 1786 if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber 1819 1787 push(@implContent, " podImp = $nativeValue;\n"); 1820 1788 } else { … … 1824 1792 push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions}; 1825 1793 } 1826 push(@implContent, " imp->commitChange(podImp, castedThis);\n") if $podType;1827 1794 if ($svgPropertyType) { 1828 1795 if (@{$attribute->setterExceptions}) { … … 1916 1883 } 1917 1884 1918 # Special case for JSSVGLengthList / JSSVGTransformList / JSSVGPointList / JSSVGNumberList1919 # Instead of having JSSVG*Custom.cpp implementations for the SVGList interface for all of these1920 # classes, we directly forward the calls to JSSVGPODListCustom, which centralizes the otherwise1921 # duplicated code for the JSSVG*List classes mentioned above.1922 my $svgPODListType;1923 if ($implClassName =~ /SVG.*List/ and !$svgListPropertyType) {1924 $svgPODListType = $implClassName;1925 $svgPODListType =~ s/List$//;1926 $svgPODListType = "" unless $codeGenerator->IsPodType($svgPODListType);1927 1928 # Ignore additional (non-SVGList) SVGTransformList methods, that are not handled through JSSVGPODListCustom1929 $svgPODListType = "" if $functionImplementationName =~ /createSVGTransformFromMatrix/;1930 $svgPODListType = "" if $functionImplementationName =~ /consolidate/;1931 }1932 1933 1885 if ($function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"JSCCustom"}) { 1934 1886 push(@implContent, " return JSValue::encode(castedThis->" . $functionImplementationName . "(exec));\n"); 1935 } elsif ($svgPODListType) {1936 $implIncludes{"JS${svgPODListType}.h"} = 1;1937 $implIncludes{"JSSVGPODListCustom.h"} = 1;1938 push(@implContent, " return JSValue::encode(JSSVGPODListCustom::$functionImplementationName<$className, " . GetNativeType($svgPODListType)1939 . ">(castedThis, exec, to" . $svgPODListType . "));\n");1940 1887 } else { 1941 1888 push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n"); 1942 push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType; 1943 push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType and $svgPropertyType; 1889 push(@implContent, " $svgPropertyOrListPropertyType& podImp = imp->propertyReference();\n") if $svgPropertyType; 1944 1890 1945 1891 my $numParameters = @{$function->parameters}; … … 1980 1926 my $argsIndex = 0; 1981 1927 my $paramIndex = 0; 1982 my $functionString = (($svgPropertyOr PodType and !$svgListPropertyType) ? "podImp." : "imp->") . $functionImplementationName . "(";1928 my $functionString = (($svgPropertyOrListPropertyType and !$svgListPropertyType) ? "podImp." : "imp->") . $functionImplementationName . "("; 1983 1929 my $hasOptionalArguments = 0; 1984 1930 … … 2025 1971 } 2026 1972 push(@implContent, " if (argsCount <= $argsIndex) {\n"); 2027 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $ podType, $svgPropertyType, $implClassName);1973 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $svgPropertyType, $implClassName); 2028 1974 push(@implContent, " }\n\n"); 2029 1975 } … … 2123 2069 2124 2070 push(@implContent, "\n"); 2125 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $ podType, $svgPropertyType, $implClassName);2071 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $svgPropertyType, $implClassName); 2126 2072 } 2127 2073 } … … 2193 2139 if ($svgPropertyType) { 2194 2140 push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object);\n"); 2195 } elsif ($podType) {2196 push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object, context);\n");2197 2141 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { 2198 2142 push(@implContent, " return getDOMObjectWrapper<$className>(exec, globalObject, object, context);\n"); … … 2204 2148 2205 2149 if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateNativeConverter"}) and !$dataNode->extendedAttributes->{"CustomNativeConverter"}) { 2206 if ($podType) { 2207 push(@implContent, "$podType to${interfaceName}(JSC::JSValue value)\n"); 2208 push(@implContent, "{\n"); 2209 push(@implContent, " return value.inherits(&${className}::s_info) ? ($podType) *static_cast<$className*>(asObject(value))->impl() : $podType()"); 2210 } else { 2211 push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n"); 2212 push(@implContent, "{\n"); 2213 push(@implContent, " return value.inherits(&${className}::s_info) ? static_cast<$className*>(asObject(value))->impl() : 0"); 2214 } 2215 2150 push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n"); 2151 push(@implContent, "{\n"); 2152 push(@implContent, " return value.inherits(&${className}::s_info) ? static_cast<$className*>(asObject(value))->impl() : 0"); 2216 2153 push(@implContent, ";\n}\n"); 2217 2154 } … … 2388 2325 my $paramIndex = shift; 2389 2326 my $indent = shift; 2390 my $podType = shift;2391 2327 my $svgPropertyType = shift; 2392 2328 my $implClassName = shift; … … 2407 2343 push(@implContent, $indent . "$functionString;\n"); 2408 2344 push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; 2409 push(@implContent, $indent . "imp->commitChange(podImp, castedThis);\n") if $podType;2410 2345 2411 2346 if ($svgPropertyType) { … … 2420 2355 push(@implContent, $indent . "return JSValue::encode(jsUndefined());\n"); 2421 2356 } else { 2422 push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $implClassName, "",$functionString, "castedThis") . ";\n");2357 push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $implClassName, $functionString, "castedThis") . ";\n"); 2423 2358 push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; 2424 2359 … … 2427 2362 push(@implContent, $indent . "if (exec->hadException())\n"); 2428 2363 push(@implContent, $indent . " return JSValue::encode(jsUndefined());\n"); 2429 }2430 2431 if ($podType and not $function->signature->extendedAttributes->{"Immutable"}) {2432 # Immutable methods do not commit changes back to the instance, thus producing2433 # a new instance rather than mutating existing one.2434 push(@implContent, $indent . "imp->commitChange(podImp, castedThis);\n");2435 2364 } 2436 2365 … … 2459 2388 "SerializedScriptValue" => "RefPtr<SerializedScriptValue>", 2460 2389 "IDBKey" => "RefPtr<IDBKey>", 2461 "SVGMatrix" => "AffineTransform",2462 2390 "SVGPaintType" => "SVGPaint::SVGPaintType", 2463 "SVGTransform" => "SVGTransform",2464 2391 "boolean" => "bool", 2465 2392 "double" => "double", … … 2509 2436 $headerIncludes{"$svgWrappedNativeType.h"} = 1; 2510 2437 $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; 2438 } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { 2439 $svgListPropertyType = $svgWrappedNativeType; 2440 $headerIncludes{"$svgWrappedNativeType.h"} = 1; 2441 $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; 2442 $headerIncludes{"SVGTransformListPropertyTearOff.h"} = 1; 2511 2443 } 2512 2444 … … 2573 2505 my $inFunctionCall = shift; 2574 2506 my $implClassName = shift; 2575 my $implClassNameForValueConversion = shift;2576 2507 my $value = shift; 2577 2508 my $thisValue = shift; … … 2607 2538 2608 2539 my $globalObject = "$thisValue->globalObject()"; 2609 if ($codeGenerator->IsPodType($type)) {2610 $implIncludes{"JS$type.h"} = 1;2611 2612 my $nativeType = GetNativeType($type);2613 2614 my $getter = $value;2615 $getter =~ s/imp->//;2616 $getter =~ s/\(\)//;2617 2618 my $setter = "set" . $codeGenerator->WK_ucfirst($getter);2619 2620 # Function calls will never return 'modifyable' POD types (ie. SVGRect getBBox()) - no need to keep track changes to the returned SVGRect2621 if ($inFunctionCall eq 02622 and not $codeGenerator->IsSVGAnimatedType($implClassName)2623 and $codeGenerator->IsPodTypeWithWriteableProperties($type)2624 and not defined $signature->extendedAttributes->{"Immutable"}) {2625 if ($codeGenerator->IsPodType($implClassName)) {2626 return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName>::create($value, $thisValue->impl()).get(), JSSVGContextCache::svgContextForDOMObject(castedThis))";2627 } else {2628 return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapperWithParent<$nativeType, $implClassName>::create(imp, &${implClassName}::$getter, &${implClassName}::$setter).get(), imp)";2629 }2630 }2631 2632 if ($implClassNameForValueConversion eq "") {2633 return "toJS(exec, $globalObject, JSSVGStaticPODTypeWrapper<$nativeType>::create($value).get(), 0 /* no context on purpose */)";2634 } else {2635 return "toJS(exec, $globalObject, JSSVGDynamicPODTypeWrapperCache<$nativeType, $implClassNameForValueConversion>::lookupOrCreateWrapper(imp, &${implClassNameForValueConversion}::$getter, &${implClassNameForValueConversion}::$setter).get(), JSSVGContextCache::svgContextForDOMObject(castedThis));"2636 }2637 }2638 2540 2639 2541 if ($type eq "CSSStyleDeclaration") { … … 2676 2578 } 2677 2579 2678 if ($codeGenerator->IsSVG NewStyleAnimatedType($implClassName)) {2580 if ($codeGenerator->IsSVGAnimatedType($implClassName)) { 2679 2581 # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked. 2680 2582 $value = "static_cast<" . GetNativeType($type) . ">($value)"; … … 2682 2584 my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($type); 2683 2585 if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and $inFunctionCall eq 0 and not defined $signature->extendedAttributes->{"Immutable"}) { 2684 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassName, /;2685 $implIncludes{"SVGStaticPropertyTearOff.h"} = 1;2686 2687 2586 my $getter = $value; 2587 $getter =~ s/imp\.//; 2688 2588 $getter =~ s/imp->//; 2689 2589 $getter =~ s/\(\)//; 2690 my $updater = "update" . $codeGenerator->WK_ucfirst($getter); 2691 $value = "${tearOffType}::create(imp, $value, &${implClassName}::$updater)"; 2590 my $updateMethod = "&${implClassName}::update" . $codeGenerator->WK_ucfirst($getter); 2591 2592 my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); 2593 if ($selfIsTearOffType) { 2594 $implIncludes{"SVGStaticPropertyWithParentTearOff.h"} = 1; 2595 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParentTearOff<$implClassName, /; 2596 2597 if ($value =~ /matrix/ and $implClassName eq "SVGTransform") { 2598 # SVGTransform offers a matrix() method for internal usage that returns an AffineTransform 2599 # and a svgMatrix() method returning a SVGMatrix, used for the bindings. 2600 $value =~ s/matrix/svgMatrix/; 2601 } 2602 2603 $value = "${tearOffType}::create(castedThis->impl(), $value, $updateMethod)"; 2604 } else { 2605 $implIncludes{"SVGStaticPropertyTearOff.h"} = 1; 2606 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassName, /; 2607 $value = "${tearOffType}::create(imp, $value, $updateMethod)"; 2608 } 2692 2609 } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) { 2693 2610 my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), "; -
trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r71512 r71802 493 493 if ($codeGenerator->IsStringType($type) || IsNativeObjCType($type)) { 494 494 push(@attributes, "copy"); 495 } elsif ($codeGenerator->Is PodType($type) || $codeGenerator->IsSVGAnimatedType($type)) {495 } elsif ($codeGenerator->IsSVGAnimatedType($type)) { 496 496 push(@attributes, "retain"); 497 497 } elsif (!$codeGenerator->IsStringType($type) && !$codeGenerator->IsPrimitiveType($type) && $type ne "DOMTimeStamp" && $type ne "CompareHow" && $type ne "SVGPaintType") { … … 588 588 } 589 589 590 if ($codeGenerator->IsSVG NewStyleAnimatedType($type)) {590 if ($codeGenerator->IsSVGAnimatedType($type)) { 591 591 $implIncludes{"${type}.h"} = 1; 592 592 $implIncludes{"DOM${type}Internal.h"} = 1; 593 return;594 }595 596 if ($codeGenerator->IsSVGAnimatedType($type)) {597 $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;598 $implIncludes{"DOM${type}Internal.h"} = 1;599 return;600 }601 602 if ($type eq "SVGMatrix") {603 $implIncludes{"AffineTransform.h"} = 1;604 $implIncludes{"DOMSVGMatrixInternal.h"} = 1;605 $implIncludes{"SVGException.h"} = 1;606 593 return; 607 594 } … … 682 669 } 683 670 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SVGStaticListPropertyTearOff/) { 671 $svgListPropertyType = "WebCore::$svgWrappedNativeType"; 672 $svgListPropertyType =~ s/</\<WebCore::/; 673 } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { 684 674 $svgListPropertyType = "WebCore::$svgWrappedNativeType"; 685 675 $svgListPropertyType =~ s/</\<WebCore::/; … … 1000 990 unless ($isProtocol) { 1001 991 # Generate internal interfaces 1002 my $podType = $dataNode->extendedAttributes->{"PODType"};1003 my $podTypeWithNamespace;1004 992 my $implClassName = GetImplClassName($interfaceName); 1005 993 my $implClassNameWithNamespace = "WebCore::" . $implClassName; … … 1009 997 $implType = $svgNativeType if $svgNativeType; 1010 998 1011 if ($podType) {1012 $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType";1013 }1014 1015 999 # Generate interface definitions. 1016 1000 @internalHeaderContent = split("\r", $implementationLicenseTemplate); … … 1018 1002 push(@internalHeaderContent, "\n#import <WebCore/$className.h>\n\n"); 1019 1003 push(@internalHeaderContent, "#import <WebCore/SVGAnimatedPropertyTearOff.h>\n\n") if $svgPropertyType; 1020 push(@internalHeaderContent, "#import <WebCore/SVGAnimatedListPropertyTearOff.h>\n\n") if $svgListPropertyType; 1004 if ($svgListPropertyType) { 1005 push(@internalHeaderContent, "#import <WebCore/SVGAnimatedListPropertyTearOff.h>\n\n"); 1006 push(@internalHeaderContent, "#import <WebCore/SVGTransformListPropertyTearOff.h>\n\n") if $svgListPropertyType =~ /SVGTransformList/; 1007 } 1021 1008 push(@internalHeaderContent, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion; 1022 1009 … … 1027 1014 my $startedNamespace = 0; 1028 1015 1029 if ($codeGenerator->IsSVG NewStyleAnimatedType($interfaceName)) {1016 if ($codeGenerator->IsSVGAnimatedType($interfaceName)) { 1030 1017 push(@internalHeaderContent, "#import <WebCore/$implClassName.h>\n\n"); 1031 } elsif ($codeGenerator->IsSVGAnimatedType($interfaceName)) {1032 push(@internalHeaderContent, "#import <WebCore/DeprecatedSVGAnimatedTemplate.h>\n\n");1033 1018 } else { 1034 1019 push(@internalHeaderContent, "namespace WebCore {\n"); 1035 1020 $startedNamespace = 1; 1036 if ($podType and $podType ne "float") { 1037 push(@internalHeaderContent, " class $podType;\n"); 1038 } elsif ($interfaceName eq "Node") { 1021 if ($interfaceName eq "Node") { 1039 1022 push(@internalHeaderContent, " class EventTarget;\n class Node;\n"); 1040 1023 } else { … … 1044 1027 } 1045 1028 1046 if ($podType) { 1047 push(@internalHeaderContent, "$podTypeWithNamespace core($className *);\n"); 1048 push(@internalHeaderContent, "$className *kit($podTypeWithNamespace);\n"); 1049 } else { 1050 push(@internalHeaderContent, "$implType* core($className *);\n"); 1051 push(@internalHeaderContent, "$className *kit($implType*);\n"); 1052 } 1029 push(@internalHeaderContent, "$implType* core($className *);\n"); 1030 push(@internalHeaderContent, "$className *kit($implType*);\n"); 1053 1031 1054 1032 if ($dataNode->extendedAttributes->{Polymorphic}) { … … 1085 1063 my $numAttributes = @{$dataNode->attributes}; 1086 1064 my $numFunctions = @{$dataNode->functions}; 1087 1088 my $podType = $dataNode->extendedAttributes->{"PODType"};1089 my $podTypeWithNamespace;1090 1065 my $implType = $implClassNameWithNamespace; 1091 1066 1092 1067 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); 1093 1068 $implType = $svgNativeType if $svgNativeType; 1094 1095 if ($podType) {1096 $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType";1097 }1098 1069 1099 1070 # - Add default header template. … … 1125 1096 $implIncludes{"DOMSVGPathSegInternal.h"} = 1 if $interfaceName =~ /^SVGPathSeg.+/; 1126 1097 1127 if ($codeGenerator->IsSVGAnimatedType($interfaceName) and !$codeGenerator->IsSVGNewStyleAnimatedType($interfaceName)) { 1128 $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1; 1129 } elsif ($interfaceName =~ /(\w+)(Abs|Rel)$/) { 1098 if ($interfaceName =~ /(\w+)(Abs|Rel)$/) { 1130 1099 $implIncludes{"$1.h"} = 1; 1131 1100 } else { 1132 if (!$podType) { 1133 if (!$codeGenerator->AvoidInclusionOfType($implClassName)) { 1134 $implIncludes{"$implClassName.h"} = 1 ; 1135 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName)) { 1136 my $includeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 1137 $implIncludes{"${includeType}.h"} = 1; 1138 } 1139 } else { 1140 $implIncludes{"$podType.h"} = 1 unless $podType eq "float"; 1101 if (!$codeGenerator->AvoidInclusionOfType($implClassName)) { 1102 $implIncludes{"$implClassName.h"} = 1 ; 1103 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName)) { 1104 my $includeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 1105 $implIncludes{"${includeType}.h"} = 1; 1141 1106 } 1142 1107 } … … 1147 1112 1148 1113 # add implementation accessor 1149 if ($podType) { 1150 push(@implContent, "#define IMPL reinterpret_cast<$podTypeWithNamespace*>(_internal)\n\n"); 1151 } elsif ($parentImplClassName eq "Object") { 1114 if ($parentImplClassName eq "Object") { 1152 1115 push(@implContent, "#define IMPL reinterpret_cast<$implType*>(_internal)\n\n"); 1153 1116 } else { … … 1172 1135 push(@implContent, " IMPL->deref();\n"); 1173 1136 push(@implContent, " };\n"); 1174 } elsif ($podType) {1175 push(@implContent, " delete IMPL;\n");1176 1137 } else { 1177 1138 push(@implContent, " if (_internal)\n"); … … 1188 1149 push(@implContent, " IMPL->deref();\n"); 1189 1150 push(@implContent, " };\n"); 1190 } elsif ($podType) {1191 push(@implContent, " delete IMPL;\n");1192 1151 } else { 1193 1152 push(@implContent, " if (_internal)\n"); … … 1286 1245 $getterContentHead = "WTF::String::number(" . $getterContentHead; 1287 1246 $getterContentTail .= ")"; 1288 } elsif ($ codeGenerator->IsPodType($idlType) or $idlType eq "Date") {1247 } elsif ($idlType eq "Date") { 1289 1248 $getterContentHead = "kit($getterContentHead"; 1290 1249 $getterContentTail .= ")"; … … 1297 1256 $getterContentHead = "IMPL->propertyReference().$getterContentHead"; 1298 1257 } 1299 } elsif ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) { 1258 1259 if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($idlType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { 1260 my $getter = $getterContentHead; 1261 $getter =~ s/\(\)//; 1262 1263 my $tearOffType = GetSVGTypeWithNamespace($idlType); 1264 my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); 1265 if ($selfIsTearOffType) { 1266 $implIncludes{"SVGStaticPropertyWithParentTearOff.h"} = 1; 1267 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParentTearOff<$implClassNameWithNamespace, /; 1268 1269 my $getter = $getterExpressionPrefix; 1270 $getter =~ s/IMPL->//; 1271 $getter =~ s/\(//; 1272 my $updateMethod = "&${implClassNameWithNamespace}::update" . $codeGenerator->WK_ucfirst($getter); 1273 1274 if ($getterContentHead =~ /matrix/ and $implClassName eq "SVGTransform") { 1275 # SVGTransform offers a matrix() method for internal usage that returns an AffineTransform 1276 # and a svgMatrix() method returning a SVGMatrix, used for the bindings. 1277 $getterContentHead =~ s/matrix/svgMatrix/; 1278 } 1279 1280 $getterContentHead = "${tearOffType}::create(IMPL, $getterContentHead$getterContentTail, $updateMethod)"; 1281 1282 $getterContentHead = "kit(WTF::getPtr($getterContentHead"; 1283 $getterContentTail = "))"; 1284 } 1285 } 1286 } elsif ($codeGenerator->IsSVGAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) { 1300 1287 my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType); 1301 1288 $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)"; … … 1321 1308 $getter =~ s/IMPL->//; 1322 1309 $getter =~ s/\(//; 1323 my $update r = "update" . $codeGenerator->WK_ucfirst($getter);1324 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create(IMPL, $getterContentHead$getterContentTail, &${implClassNameWithNamespace}::$updater";1310 my $updateMethod = "&${implClassNameWithNamespace}::update" . $codeGenerator->WK_ucfirst($getter); 1311 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create(IMPL, $getterContentHead$getterContentTail, $updateMethod"; 1325 1312 $getterContentTail .= "))"; 1326 1313 } elsif ($idlTypeWithNamespace =~ /SVGStaticListPropertyTearOff/) { … … 1430 1417 $getterContentHead = "$getterExpressionPrefix"; 1431 1418 push(@implContent, " IMPL->$coreSetterName($arg);\n"); 1432 } elsif ($podType) {1433 push(@implContent, " IMPL->$coreSetterName($arg);\n");1434 1419 } else { 1435 1420 my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute); … … 1548 1533 1549 1534 # FIXME! We need [Custom] support for ObjC, to move these hacks into DOMSVGLength/MatrixCustom.mm 1550 my $svgMatrixRotateFromVector = ($podType and $podType eq "AffineTransform" and $functionName eq "rotateFromVector");1551 my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse");1552 1535 my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq "WebCore::SVGLength" and $functionName eq "convertToSpecifiedUnits"); 1553 1536 1554 1537 push(@parameterNames, "IMPL->contextElement()") if $svgLengthConvertToSpecifiedUnits; 1555 push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse);1538 push(@parameterNames, "ec") if $raisesExceptions; 1556 1539 1557 1540 # Handle arguments that are 'SVGProperty' based (SVGAngle/SVGLength). We need to convert from SVGPropertyTearOff<Type>* to Type, … … 1562 1545 1563 1546 my $paramName = $param->name; 1547 1548 # make a new parameter name if the original conflicts with a property name 1549 $paramName = "in" . ucfirst($paramName) if $attributeNames{$paramName}; 1550 1564 1551 my $idlType = $codeGenerator->StripModule($param->type); 1565 1552 next if not $codeGenerator->IsSVGTypeNeedingTearOff($idlType) or $implClassName =~ /List$/; … … 1592 1579 } 1593 1580 1594 if ($svgMatrixRotateFromVector) { 1595 # Special case with rotateFromVector & SVGMatrix 1596 push(@functionContent, " $exceptionInit\n"); 1597 push(@functionContent, " if (x == 0.0 || y == 0.0)\n"); 1598 push(@functionContent, " ec = WebCore::SVGException::SVG_INVALID_VALUE_ERR;\n"); 1599 push(@functionContent, " $exceptionRaiseOnError\n"); 1600 push(@functionContent, " return kit($content);\n"); 1601 } elsif ($svgMatrixInverse) { 1602 # Special case with inverse & SVGMatrix 1603 push(@functionContent, " $exceptionInit\n"); 1604 push(@functionContent, " if (!$caller->isInvertible())\n"); 1605 push(@functionContent, " ec = WebCore::SVGException::SVG_MATRIX_NOT_INVERTABLE;\n"); 1606 push(@functionContent, " $exceptionRaiseOnError\n"); 1607 push(@functionContent, " return kit($content);\n"); 1608 } elsif ($returnType eq "void") { 1581 if ($returnType eq "void") { 1609 1582 # Special case 'void' return type. 1610 1583 if ($raisesExceptions) { … … 1618 1591 } else { 1619 1592 push(@functionContent, " $content;\n"); 1620 push(@functionContent, " IMPL->commitChange() \n") if $svgPropertyType;1593 push(@functionContent, " IMPL->commitChange();\n") if $svgPropertyType; 1621 1594 } 1622 1595 } elsif (defined $needsCustom{"NodeToReturn"}) { … … 1642 1615 my $idlTypeWithNamespace = GetSVGTypeWithNamespace($function->signature->type); 1643 1616 $content = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($content)))"; 1644 } elsif ($codeGenerator->IsPodType($function->signature->type)) {1645 $content = "kit($content)";1646 1617 } else { 1647 1618 $content = "kit(WTF::getPtr($content))"; … … 1694 1665 1695 1666 # Generate internal interfaces 1696 if ($podType) { 1697 push(@implContent, "\n$podTypeWithNamespace core($className *wrapper)\n"); 1698 push(@implContent, "{\n"); 1699 push(@implContent, " return wrapper ? *reinterpret_cast<$podTypeWithNamespace*>(wrapper->_internal) : $podTypeWithNamespace();\n"); 1700 push(@implContent, "}\n\n"); 1701 } else { 1702 push(@implContent, "\n$implType* core($className *wrapper)\n"); 1703 push(@implContent, "{\n"); 1704 push(@implContent, " return wrapper ? reinterpret_cast<$implType*>(wrapper->_internal) : 0;\n"); 1705 push(@implContent, "}\n\n"); 1706 } 1707 1708 if ($podType) { 1709 # FIXME: Implement caching. 1710 push(@implContent, "$className *kit($podTypeWithNamespace value)\n"); 1711 push(@implContent, "{\n"); 1712 push(@implContent, " $assertMainThread;\n"); 1713 push(@implContent, " $className *wrapper = [[$className alloc] _init];\n"); 1714 push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(new $podTypeWithNamespace(value));\n"); 1715 push(@implContent, " return [wrapper autorelease];\n"); 1716 push(@implContent, "}\n"); 1717 } elsif ($parentImplClassName eq "Object") { 1667 push(@implContent, "\n$implType* core($className *wrapper)\n"); 1668 push(@implContent, "{\n"); 1669 push(@implContent, " return wrapper ? reinterpret_cast<$implType*>(wrapper->_internal) : 0;\n"); 1670 push(@implContent, "}\n\n"); 1671 1672 if ($parentImplClassName eq "Object") { 1718 1673 push(@implContent, "$className *kit($implType* value)\n"); 1719 1674 push(@implContent, "{\n"); -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r71711 r71802 88 88 } 89 89 90 # Workaround for V8 bindings difference where RGBColor is not a POD type.91 # FIXME: This method will go away once all SVG animated properties are converted to the new scheme.92 sub IsPodType93 {94 my $type = shift;95 return $codeGenerator->IsPodType($type);96 }97 98 90 # Params: 'domClass' struct 99 91 sub GenerateInterface … … 168 160 $implIncludes{"wtf/text/AtomicString.h"} = 1; 169 161 } 170 }171 172 sub AddIncludesForSVGAnimatedType173 {174 my $type = shift;175 return if $codeGenerator->IsSVGNewStyleAnimatedType($type);176 177 $type =~ s/SVGAnimated//;178 179 if ($type eq "Point" or $type eq "Rect") {180 $implIncludes{"Float$type.h"} = 1;181 } elsif ($type eq "String") {182 $implIncludes{"PlatformString.h"} = 1;183 }184 185 $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;186 162 } 187 163 … … 227 203 $svgListPropertyType = $svgWrappedNativeType; 228 204 $implIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; 229 } 230 231 $svgPropertyType = "SVGPoint" if $svgPropertyType eq "FloatPoint"; 205 } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { 206 $svgListPropertyType = $svgWrappedNativeType; 207 $implIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; 208 $implIncludes{"SVGTransformListPropertyTearOff.h"} = 1; 209 } 210 211 if ($svgPropertyType) { 212 $svgPropertyType = "SVGPoint" if $svgPropertyType eq "FloatPoint"; 213 } 214 232 215 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); 233 216 } … … 250 233 # - Add default header template 251 234 push(@headerContent, GenerateHeaderContentHeader($dataNode)); 252 my $podType = $dataNode->extendedAttributes->{"PODType"};253 235 254 236 my %headerInclues = (); 255 $headerIncludes{"$podType.h"} = 1 if $podType and ($podType ne "double" and $podType ne "float" and $podType ne "RGBA32");256 237 $headerIncludes{"wtf/text/StringHash.h"} = 1; 257 238 $headerIncludes{"WrapperTypeInfo.h"} = 1; … … 271 252 272 253 push(@headerContent, "\nnamespace WebCore {\n"); 273 push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n") if $podType;274 254 push(@headerContent, "\ntemplate<typename PropertyType> class SVGPropertyTearOff;\n") if $svgPropertyType; 275 255 if ($svgListPropertyType) { … … 479 459 } 480 460 return "" if ($codeGenerator->AvoidInclusionOfType($className)); 481 return "DeprecatedSVGAnimatedTemplate.h" if $codeGenerator->IsSVGAnimatedType($className) and !$codeGenerator->IsSVGNewStyleAnimatedType($className);482 461 return "${className}.h"; 483 462 } … … 705 684 706 685 my $attrType = GetTypeFromSignature($attribute->signature); 707 my $attrIsPodType = IsPodType($attrType);708 686 709 687 my $nativeType = GetNativeTypeFromSignature($attribute->signature, -1); 710 my $isPodType = IsPodType($implClassName);711 688 my $skipContext = 0; 712 713 if ($isPodType) {714 $implClassName = GetNativeType($implClassName);715 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1;716 }717 689 718 690 # Special case: SVGZoomEvent's attributes are all read-only 719 691 if ($implClassName eq "SVGZoomEvent") { 720 $attrIsPodType = 0;721 692 $skipContext = 1; 722 }723 724 # Special case for SVGColor725 if (($implClassName eq "SVGColor") and ($attrName eq "rgbColor")) {726 $attrIsPodType = 0;727 693 } 728 694 … … 740 706 END 741 707 742 if ($isPodType) { 743 push(@implContentDecls, <<END); 744 V8SVGPODTypeWrapper<$implClassName>* impWrapper = V8SVGPODTypeWrapper<$implClassName>::toNative(info.Holder()); 745 $implClassName impInstance = *impWrapper; 746 END 747 if ($getterStringUsesImp) { 748 push(@implContentDecls, <<END); 749 $implClassName* imp = &impInstance; 750 END 751 } 752 } elsif ($svgNativeType) { 708 if ($svgNativeType) { 753 709 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 754 if ($svgWrappedNativeType =~ /List $/) {710 if ($svgWrappedNativeType =~ /List/) { 755 711 push(@implContentDecls, <<END); 756 712 $svgNativeType* imp = V8${implClassName}::toNative(info.Holder()); … … 809 765 } 810 766 811 my $useExceptions = 1 if @{$attribute->getterExceptions} and !($isPodType);767 my $useExceptions = 1 if @{$attribute->getterExceptions}; 812 768 if ($useExceptions) { 813 769 $implIncludes{"ExceptionCode.h"} = 1; … … 833 789 my $wrapper; 834 790 835 if ($attrIsPodType) { 836 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1; 837 838 my $getter = $getterString; 839 $getter =~ s/imp->//; 840 $getter =~ s/\(\)//; 841 my $setter = "set" . $codeGenerator->WK_ucfirst($getter); 842 843 my $implClassIsAnimatedType = $codeGenerator->IsSVGAnimatedType($implClassName); 844 if (not $implClassIsAnimatedType and $codeGenerator->IsPodTypeWithWriteableProperties($attrType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { 845 if (IsPodType($implClassName)) { 846 my $wrapper = "V8SVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName>::create($getterString, impWrapper)"; 847 push(@implContentDecls, " RefPtr<V8SVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName> > wrapper = $wrapper;\n"); 848 } else { 849 my $wrapper = "V8SVGStaticPODTypeWrapperWithParent<$nativeType, $implClassName>::create(imp, &${implClassName}::$getter, &${implClassName}::$setter)"; 850 push(@implContentDecls, " RefPtr<V8SVGStaticPODTypeWrapperWithParent<$nativeType, $implClassName> > wrapper = $wrapper;\n"); 851 } 791 if ($attribute->signature->type eq "EventListener" && $dataNode->name eq "DOMWindow") { 792 push(@implContentDecls, " if (!imp->document())\n"); 793 push(@implContentDecls, " return v8::Handle<v8::Value>();\n"); 794 } 795 796 if ($useExceptions) { 797 if ($nativeType =~ /^V8Parameter/) { 798 push(@implContentDecls, " " . ConvertToV8Parameter($attribute->signature, $nativeType, "v", $getterString) . ";\n"); 852 799 } else { 853 if ($implClassIsAnimatedType) { 854 # We can't hash member function pointers, so instead generate 855 # some hashing material based on the names of the methods. 856 my $hashhex = substr(Digest::MD5::md5_hex("${implClassName}::$getter ${implClassName}::$setter)"), 0, 8); 857 my $wrapper = "V8SVGDynamicPODTypeWrapperCache<$nativeType, $implClassName>::lookupOrCreateWrapper(imp, &${implClassName}::$getter, &${implClassName}::$setter, 0x$hashhex)"; 858 push(@implContentDecls, " RefPtr<V8SVGPODTypeWrapper<" . $nativeType . "> > wrapper = $wrapper;\n"); 859 } else { 860 my $wrapper = GenerateSVGStaticPodTypeWrapper($returnType, $getterString); 861 push(@implContentDecls, " RefPtr<V8SVGStaticPODTypeWrapper<" . $nativeType . "> > wrapper = $wrapper;\n"); 862 } 863 } 864 800 push(@implContentDecls, " $nativeType v = $getterString;\n"); 801 } 802 push(@implContentDecls, GenerateSetDOMException(" ")); 803 $result = "v"; 804 $result .= ".release()" if (IsRefPtrType($returnType)); 865 805 } else { 866 if ($attribute->signature->type eq "EventListener" && $dataNode->name eq "DOMWindow") { 867 push(@implContentDecls, " if (!imp->document())\n"); 868 push(@implContentDecls, " return v8::Handle<v8::Value>();\n"); 869 } 870 871 if ($useExceptions) { 872 if ($nativeType =~ /^V8Parameter/) { 873 push(@implContentDecls, " " . ConvertToV8Parameter($attribute->signature, $nativeType, "v", $getterString) . ";\n"); 874 } else { 875 push(@implContentDecls, " $nativeType v = $getterString;\n"); 876 } 877 push(@implContentDecls, GenerateSetDOMException(" ")); 878 $result = "v"; 879 $result .= ".release()" if (IsRefPtrType($returnType)); 806 # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary 807 $result = $getterString; 808 } 809 810 # Special case for readonly or Replaceable attributes (with a few exceptions). This attempts to ensure that JS wrappers don't get 811 # garbage-collected prematurely when their lifetime is strongly tied to their owner. We accomplish this by inserting a reference to 812 # the newly created wrapper into an internal field of the holder object. 813 if (!IsNodeSubType($dataNode) && $attrName ne "self" && (IsWrapperType($returnType) && ($attribute->type =~ /^readonly/ || $attribute->signature->extendedAttributes->{"Replaceable"}) 814 && $returnType ne "EventTarget" && $returnType ne "SerializedScriptValue" && $returnType ne "DOMWindow" 815 && $returnType !~ /SVG/ && $returnType !~ /HTML/ && !IsDOMNodeType($returnType))) { 816 AddIncludesForType($returnType); 817 my $domMapFunction = GetDomMapFunction(0, $returnType); 818 # Check for a wrapper in the wrapper cache. If there is one, we know that a hidden reference has already 819 # been created. If we don't find a wrapper, we create both a wrapper and a hidden reference. 820 push(@implContentDecls, " RefPtr<$returnType> result = ${getterString};\n"); 821 push(@implContentDecls, " v8::Handle<v8::Value> wrapper = result.get() ? ${domMapFunction}.get(result.get()) : v8::Handle<v8::Value>();\n"); 822 push(@implContentDecls, " if (wrapper.IsEmpty()) {\n"); 823 push(@implContentDecls, " wrapper = toV8(result.get());\n"); 824 push(@implContentDecls, " if (!wrapper.IsEmpty())\n"); 825 if ($dataNode->name eq "DOMWindow") { 826 push(@implContentDecls, " V8DOMWrapper::setHiddenWindowReference(imp->frame(), wrapper);\n"); 880 827 } else { 881 # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary 882 $result = $getterString; 883 } 884 885 # Special case for readonly or Replaceable attributes (with a few exceptions). This attempts to ensure that JS wrappers don't get 886 # garbage-collected prematurely when their lifetime is strongly tied to their owner. We accomplish this by inserting a reference to 887 # the newly created wrapper into an internal field of the holder object. 888 if (!IsNodeSubType($dataNode) && $attrName ne "self" && (IsWrapperType($returnType) && ($attribute->type =~ /^readonly/ || $attribute->signature->extendedAttributes->{"Replaceable"}) 889 && $returnType ne "EventTarget" && $returnType ne "SerializedScriptValue" && $returnType ne "DOMWindow" 890 && $returnType !~ /SVG/ && $returnType !~ /HTML/ && !IsDOMNodeType($returnType))) { 891 AddIncludesForType($returnType); 892 my $domMapFunction = GetDomMapFunction(0, $returnType); 893 # Check for a wrapper in the wrapper cache. If there is one, we know that a hidden reference has already 894 # been created. If we don't find a wrapper, we create both a wrapper and a hidden reference. 895 push(@implContentDecls, " RefPtr<$returnType> result = ${getterString};\n"); 896 push(@implContentDecls, " v8::Handle<v8::Value> wrapper = result.get() ? ${domMapFunction}.get(result.get()) : v8::Handle<v8::Value>();\n"); 897 push(@implContentDecls, " if (wrapper.IsEmpty()) {\n"); 898 push(@implContentDecls, " wrapper = toV8(result.get());\n"); 899 push(@implContentDecls, " if (!wrapper.IsEmpty())\n"); 900 if ($dataNode->name eq "DOMWindow") { 901 push(@implContentDecls, " V8DOMWrapper::setHiddenWindowReference(imp->frame(), wrapper);\n"); 902 } else { 903 push(@implContentDecls, " V8DOMWrapper::setHiddenReference(info.Holder(), wrapper);\n"); 904 } 905 push(@implContentDecls, " }\n"); 906 push(@implContentDecls, " return wrapper;\n"); 907 push(@implContentDecls, "}\n\n"); 908 push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; 909 return; 910 } 828 push(@implContentDecls, " V8DOMWrapper::setHiddenReference(info.Holder(), wrapper);\n"); 829 } 830 push(@implContentDecls, " }\n"); 831 push(@implContentDecls, " return wrapper;\n"); 832 push(@implContentDecls, "}\n\n"); 833 push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; 834 return; 911 835 } 912 836 913 837 if (IsSVGTypeNeedingContextParameter($attrType) && !$skipContext) { 914 if ($attrIsPodType) { 915 push(@implContentDecls, GenerateSVGContextAssignment($implClassName, "wrapper.get()", " ")); 916 } else { 917 push(@implContentDecls, GenerateSVGContextRetrieval($implClassName, " ")); 918 # The templating associated with passing withSVGContext()'s return value directly into toV8 can get compilers confused, 919 # so just manually set the return value to a PassRefPtr of the expected type. 920 push(@implContentDecls, " PassRefPtr<$attrType> resultAsPassRefPtr = V8Proxy::withSVGContext($result, context);\n"); 921 $result = "resultAsPassRefPtr"; 922 } 923 } 924 925 if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) { 838 push(@implContentDecls, GenerateSVGContextRetrieval($implClassName, " ")); 839 # The templating associated with passing withSVGContext()'s return value directly into toV8 can get compilers confused, 840 # so just manually set the return value to a PassRefPtr of the expected type. 841 push(@implContentDecls, " PassRefPtr<$attrType> resultAsPassRefPtr = V8Proxy::withSVGContext($result, context);\n"); 842 $result = "resultAsPassRefPtr"; 843 } 844 845 if ($codeGenerator->IsSVGAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) { 926 846 $implIncludes{"V8$attrType.h"} = 1; 927 847 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); … … 933 853 my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); 934 854 if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($attrType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { 935 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassName, /;936 $implIncludes{"SVGStaticPropertyTearOff.h"} = 1;937 938 855 my $getter = $result; 939 856 $getter =~ s/imp->//; 940 857 $getter =~ s/\(\)//; 941 my $updater = "update" . $codeGenerator->WK_ucfirst($getter); 942 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create(imp, $result, &${implClassName}::$updater)));\n"); 858 859 my $updateMethod = "&${implClassName}::update" . $codeGenerator->WK_ucfirst($getter); 860 861 my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); 862 if ($selfIsTearOffType) { 863 $implIncludes{"SVGStaticPropertyWithParentTearOff.h"} = 1; 864 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParentTearOff<$implClassName, /; 865 866 if ($result =~ /matrix/ and $implClassName eq "SVGTransform") { 867 # SVGTransform offers a matrix() method for internal usage that returns an AffineTransform 868 # and a svgMatrix() method returning a SVGMatrix, used for the bindings. 869 $result =~ s/matrix/svgMatrix/; 870 } 871 872 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create(wrapper, $result, $updateMethod)));\n"); 873 } else { 874 $implIncludes{"SVGStaticPropertyTearOff.h"} = 1; 875 $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassName, /; 876 877 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create(imp, $result, $updateMethod)));\n"); 878 } 943 879 } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) { 944 880 my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), "; … … 949 885 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create($result)));\n"); 950 886 } 951 } elsif ($attrIsPodType) {952 $implIncludes{"V8${attrType}.h"} = 1;953 push(@implContentDecls, " return toV8(wrapper.release().get());\n");954 887 } else { 955 888 push(@implContentDecls, " " . ReturnNativeToJSValue($attribute->signature, $result, " ").";\n"); … … 1004 937 } 1005 938 1006 my $isPodType = IsPodType($implClassName);1007 939 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName); 1008 1009 if ($isPodType) { 1010 $implClassName = GetNativeType($implClassName); 1011 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1; 1012 push(@implContentDecls, " V8SVGPODTypeWrapper<$implClassName>* wrapper = V8SVGPODTypeWrapper<$implClassName>::toNative(info.Holder());\n"); 1013 push(@implContentDecls, " $implClassName impInstance = *wrapper;\n"); 1014 push(@implContentDecls, " $implClassName* imp = &impInstance;\n"); 1015 } elsif ($svgNativeType) { 940 if ($svgNativeType) { 1016 941 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 1017 942 if ($svgWrappedNativeType =~ /List$/) { … … 1083 1008 } 1084 1009 1085 my $useExceptions = 1 if @{$attribute->setterExceptions} and !($isPodType);1010 my $useExceptions = 1 if @{$attribute->setterExceptions}; 1086 1011 1087 1012 if ($useExceptions) { … … 1117 1042 } 1118 1043 1119 if ($isPodType) { 1120 push(@implContentDecls, " wrapper->commitChange(*imp, V8Proxy::svgContext(wrapper));\n"); 1121 } elsif ($svgNativeType) { 1044 if ($svgNativeType) { 1122 1045 if ($useExceptions) { 1123 1046 push(@implContentDecls, " if (!ec)\n"); … … 1128 1051 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { 1129 1052 $implIncludes{"SVGElement.h"} = 1; 1130 1131 my $currentObject = "imp"; 1132 if ($isPodType) { 1133 $currentObject = "wrapper"; 1134 } 1135 1136 push(@implContentDecls, " if (SVGElement* context = V8Proxy::svgContext($currentObject))\n"); 1053 push(@implContentDecls, " if (SVGElement* context = V8Proxy::svgContext(imp))\n"); 1137 1054 push(@implContentDecls, " context->svgAttributeChanged(imp->associatedAttributeName());\n"); 1138 1055 } 1139 1056 1140 1057 push(@implContentDecls, " return;\n"); 1141 1058 push(@implContentDecls, "}\n\n"); # end of setter … … 1328 1245 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); 1329 1246 1330 if (IsPodType($implClassName)) { 1331 my $nativeClassName = GetNativeType($implClassName); 1332 push(@implContentDecls, " V8SVGPODTypeWrapper<$nativeClassName>* impWrapper = V8SVGPODTypeWrapper<$nativeClassName>::toNative(args.Holder());\n"); 1333 push(@implContentDecls, " $nativeClassName impInstance = *impWrapper;\n"); 1334 push(@implContentDecls, " $nativeClassName* imp = &impInstance;\n"); 1335 } elsif ($svgNativeType) { 1247 if ($svgNativeType) { 1336 1248 my $nativeClassName = GetNativeType($implClassName); 1337 1249 if ($implClassName =~ /List$/) { 1338 push(@implContentDecls, " $nativeClassName imp = V8${ svgListPropertyType}::toNative(args.Holder());\n");1250 push(@implContentDecls, " $nativeClassName imp = V8${implClassName}::toNative(args.Holder());\n"); 1339 1251 } else { 1340 1252 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 1341 push(@implContentDecls, " $nativeClassName wrapper = V8${ svgPropertyType}::toNative(args.Holder());\n");1253 push(@implContentDecls, " $nativeClassName wrapper = V8${implClassName}::toNative(args.Holder());\n"); 1342 1254 push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n"); 1343 1255 push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n"); … … 1411 1323 push(@implContentDecls, $functionCall); 1412 1324 push(@implContentDecls, " }\n"); 1413 }1414 1415 if (BasicTypeCanFailConversion($parameter)) {1416 push(@implContentDecls, " bool ${parameterName}Ok;\n");1417 1325 } 1418 1326 … … 1442 1350 } elsif (TypeCanFailConversion($parameter)) { 1443 1351 push(@implContentDecls, " $nativeType $parameterName = " . 1444 JSValueToNative($parameter, "args[$paramIndex]" , BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef) . ";\n");1445 push(@implContentDecls, " if (UNLIKELY(!$parameterName " . (BasicTypeCanFailConversion($parameter) ? "Ok" : "") . ")) {\n");1352 JSValueToNative($parameter, "args[$paramIndex]") . ";\n"); 1353 push(@implContentDecls, " if (UNLIKELY(!$parameterName)) {\n"); 1446 1354 push(@implContentDecls, " ec = TYPE_MISMATCH_ERR;\n"); 1447 1355 push(@implContentDecls, " goto fail;\n"); 1448 1356 push(@implContentDecls, " }\n"); 1449 1357 } elsif ($nativeType =~ /^V8Parameter/) { 1450 my $value = JSValueToNative($parameter, "args[$paramIndex]" , BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef);1358 my $value = JSValueToNative($parameter, "args[$paramIndex]"); 1451 1359 push(@implContentDecls, " " . ConvertToV8Parameter($parameter, $nativeType, $parameterName, $value) . "\n"); 1452 1360 } else { … … 1475 1383 } 1476 1384 push(@implContentDecls, " EXCEPTION_BLOCK($nativeType, $parameterName, " . 1477 JSValueToNative($parameter, "args[$paramIndex]" , BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef) . ");\n");1385 JSValueToNative($parameter, "args[$paramIndex]") . ");\n"); 1478 1386 } 1479 1387 … … 1815 1723 my $className = "V8$interfaceName"; 1816 1724 my $implClassName = $interfaceName; 1817 1818 1725 my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"}; 1819 1726 … … 1827 1734 $implIncludes{"V8DOMWrapper.h"} = 1; 1828 1735 $implIncludes{"V8IsolatedContext.h"} = 1; 1829 1830 if ($className =~ /^V8SVGAnimated/) {1831 AddIncludesForSVGAnimatedType($interfaceName);1832 }1833 1736 1834 1737 AddIncludesForType($interfaceName); … … 2669 2572 return "getDOMNodeMap()" if ($dataNode && IsNodeSubType($dataNode)); 2670 2573 # Only use getDOMSVGObjectWithContextMap() for non-node svg objects 2671 return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/ and $type ne "SVGLength" and $type ne "SVGLengthList" and not $codeGenerator->IsSVGNewStyleAnimatedType($type);2574 return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/ and not $codeGenerator->IsSVGTypeNeedingTearOff($type) and not $codeGenerator->IsSVGAnimatedType($type); 2672 2575 return "" if $type eq "DOMImplementation"; 2673 2576 return "getActiveDOMObjectMap()" if IsActiveDomType($type); … … 2697 2600 my $type = shift; 2698 2601 2699 $type = "AffineTransform" if $type eq "SVGMatrix";2700 $type = "V8SVGPODTypeWrapper<$type>" if $dataNode->extendedAttributes->{"PODType"};2701 2602 $type = $codeGenerator->GetSVGTypeNeedingTearOff($type) if $codeGenerator->IsSVGTypeNeedingTearOff($type); 2702 2603 return $type; … … 2711 2612 2712 2613 my $name = $function->signature->name; 2713 my $isPodType = IsPodType($implClassName);2714 2614 my $returnType = GetTypeFromSignature($function->signature); 2715 my $returnsPodType = IsPodType($returnType);2716 2615 my $nativeReturnType = GetNativeType($returnType, 0); 2717 2616 my $result = ""; … … 2720 2619 $nativeReturnType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($returnType) if $isSVGTearOffType; 2721 2620 2722 # Special case: SVG matrix transform methods should not mutate2723 # the matrix but return a copy2724 my $copyFirst = 0;2725 if ($implClassName eq "SVGMatrix" && $function->signature->type eq "SVGMatrix") {2726 $copyFirst = 1;2727 }2728 2729 2621 if ($function->signature->extendedAttributes->{"v8implname"}) { 2730 2622 $name = $function->signature->extendedAttributes->{"v8implname"}; … … 2736 2628 2737 2629 my $functionString = "imp->${name}("; 2738 2739 if ($copyFirst) {2740 $functionString = "result.${name}(";2741 }2742 2743 2630 if ($function->signature->extendedAttributes->{"ClassMethod"}) { 2744 2631 $functionString = "${implClassName}::${name}("; 2745 }2746 2747 my $returnsListItemPodType = 0;2748 # SVG lists functions that return POD types require special handling2749 if (IsSVGListTypeNeedingSpecialHandling($implClassName) && IsSVGListMethod($name) && $returnsPodType) {2750 $returnsListItemPodType = 1;2751 $result .= $indent . "SVGList<RefPtr<SVGPODListItem<$nativeReturnType> > >* listImp = imp;\n";2752 $functionString = "listImp->${name}(";2753 2632 } 2754 2633 … … 2788 2667 my $paramType = $parameter->type; 2789 2668 2790 # This is a bit of a hack... we need to convert parameters to methods on SVG lists2791 # of POD types which are items in the list to appropriate SVGList<> instances2792 if ($returnsListItemPodType && $paramType . "List" eq $implClassName) {2793 $paramName = "SVGPODListItem<" . GetNativeType($paramType, 1) . ">::copy($paramName)";2794 }2795 2796 2669 if ($parameter->type eq "NodeFilter" || $parameter->type eq "XPathNSResolver") { 2797 2670 $functionString .= "$paramName.get()"; … … 2802 2675 $result .= $indent . " return v8::Handle<v8::Value>();\n"; 2803 2676 $result .= $indent . "}\n"; 2677 } elsif ($parameter->type eq "SVGMatrix" and $implClassName eq "SVGTransformList") { 2678 $functionString .= "$paramName.get()"; 2804 2679 } else { 2805 2680 $functionString .= $paramName; … … 2834 2709 if ($returnType eq "void") { 2835 2710 $result .= $indent . "$functionString;\n"; 2836 } elsif ($copyFirst) { 2837 $result .= $indent . GetNativeType($returnType, 0) . " result = *imp;\n" . $indent . "$functionString;\n"; 2838 } elsif ($returnsListItemPodType) { 2839 $result .= $indent . "RefPtr<SVGPODListItem<$nativeReturnType> > result = $functionString;\n"; 2840 } elsif ($hasScriptState or @{$function->raisesExceptions} or $returnsPodType or $isPodType or IsSVGTypeNeedingContextParameter($returnType)) { 2711 } elsif ($hasScriptState or @{$function->raisesExceptions}) { 2841 2712 $result .= $indent . $nativeReturnType . " result = $functionString;\n"; 2842 2713 } else { … … 2844 2715 $return = $functionString; 2845 2716 $returnIsRef = 0; 2717 2718 if ($implClassName eq "SVGTransformList" and IsRefPtrType($returnType)) { 2719 $return = "WTF::getPtr(" . $return . ")"; 2720 } 2846 2721 } 2847 2722 … … 2854 2729 $result .= $indent . "if (state.hadException())\n"; 2855 2730 $result .= $indent . " return throwError(state.exception());\n" 2856 }2857 2858 # If the return type is a POD type, separate out the wrapper generation2859 if ($returnsListItemPodType) {2860 $result .= $indent . "RefPtr<V8SVGPODTypeWrapper<" . $nativeReturnType . "> > wrapper = ";2861 $result .= "V8SVGPODTypeWrapperCreatorForList<" . $nativeReturnType . ">::create($return, imp->associatedAttributeName());\n";2862 $return = "wrapper";2863 } elsif ($returnsPodType) {2864 $result .= $indent . "RefPtr<V8SVGPODTypeWrapper<" . $nativeReturnType . "> > wrapper = ";2865 $result .= GenerateSVGStaticPodTypeWrapper($returnType, $return) . ";\n";2866 $return = "wrapper";2867 2731 } 2868 2732 … … 2893 2757 2894 2758 # If the implementing class is a POD type, commit changes 2895 if ($isPodType) { 2896 if (!$generatedSVGContextRetrieval) { 2897 $result .= GenerateSVGContextRetrieval($implClassName, $indent); 2898 $generatedSVGContextRetrieval = 1; 2899 } 2900 2901 $result .= $indent . "impWrapper->commitChange(impInstance, context);\n"; 2902 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName) and not $implClassName =~ /List$/) { 2759 if ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName) and not $implClassName =~ /List$/) { 2903 2760 $result .= $indent . "wrapper->commitChange();\n"; 2904 2761 } 2905 2762 2906 if ($returnsPodType) { 2907 $implIncludes{"V8${returnType}.h"} = 1; 2908 $result .= $indent . "return toV8(wrapper.release());\n"; 2909 } else { 2910 $return .= ".release()" if ($returnIsRef); 2911 $result .= $indent . ReturnNativeToJSValue($function->signature, $return, $indent) . ";\n"; 2912 } 2763 $return .= ".release()" if ($returnIsRef); 2764 $result .= $indent . ReturnNativeToJSValue($function->signature, $return, $indent) . ";\n"; 2913 2765 2914 2766 return $result; … … 2998 2850 return "String" if $type eq "DOMString"; 2999 2851 return "Range::CompareHow" if $type eq "CompareHow"; 3000 return "AffineTransform" if $type eq "SVGMatrix";3001 return "SVGTransform" if $type eq "SVGTransform";3002 2852 return "SVGPaint::SVGPaintType" if $type eq "SVGPaintType"; 3003 2853 return "DOMTimeStamp" if $type eq "DOMTimeStamp"; … … 3044 2894 } 3045 2895 3046 sub BasicTypeCanFailConversion3047 {3048 my $signature = shift;3049 my $type = GetTypeFromSignature($signature);3050 3051 return 1 if $type eq "SVGMatrix";3052 return 1 if $type eq "SVGTransform";3053 return 0;3054 }3055 3056 2896 sub TypeCanFailConversion 3057 2897 { … … 3064 2904 return 1 if $type eq "VoidCallback"; 3065 2905 return 1 if $type eq "IDBKey"; 3066 return BasicTypeCanFailConversion($signature);2906 return 0; 3067 2907 } 3068 2908 … … 3071 2911 my $signature = shift; 3072 2912 my $value = shift; 3073 my $okParam = shift;3074 my $maybeOkParam = $okParam ? ", ${okParam}" : "";3075 2913 3076 2914 my $type = GetTypeFromSignature($signature); … … 3080 2918 return "static_cast<$type>($value->NumberValue())" if $type eq "float" or $type eq "double"; 3081 2919 3082 return "toInt32($value ${maybeOkParam})" if $type eq "long";3083 return "toUInt32($value ${maybeOkParam})" if $type eq "unsigned long" or $type eq "unsigned short";2920 return "toInt32($value)" if $type eq "long"; 2921 return "toUInt32($value)" if $type eq "unsigned long" or $type eq "unsigned short"; 3084 2922 return "toInt64($value)" if $type eq "unsigned long long" or $type eq "long long"; 3085 2923 return "static_cast<Range::CompareHow>($value->Int32Value())" if $type eq "CompareHow"; … … 3134 2972 } else { 3135 2973 $implIncludes{"V8$type.h"} = 1; 3136 3137 if (IsPodType($type)) {3138 my $nativeType = GetNativeType($type);3139 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1;3140 3141 return "V8SVGPODTypeUtil::toSVGPODType<${nativeType}>(&V8${type}::info, $value${maybeOkParam})"3142 }3143 3144 $implIncludes{"V8${type}.h"} = 1;3145 2974 3146 2975 # Perform type checks on the parameter, if it is expected Node type, … … 3240 3069 'CompareHow' => 1, 3241 3070 'SerializedScriptValue' => 1, 3242 'SVGAngle' => 1,3243 'SVGRect' => 1,3244 'SVGPoint' => 1,3245 'SVGPreserveAspectRatio' => 1,3246 'SVGMatrix' => 1,3247 'SVGTransform' => 1,3248 'SVGLength' => 1,3249 'SVGNumber' => 1,3250 3071 'SVGPaintType' => 1, 3251 3072 'DOMTimeStamp' => 1, … … 3358 3179 $implIncludes{"wtf/GetPtr.h"} = 1; 3359 3180 3360 if (IsPodType($type)) {3361 $value = GenerateSVGStaticPodTypeWrapper($type, $value) . ".get()";3362 }3363 3364 3181 return "return toV8($value)"; 3365 }3366 3367 # FIXME: This method will go away once all SVG animated properties are converted to the new scheme.3368 sub GenerateSVGStaticPodTypeWrapper {3369 my $type = shift;3370 my $value = shift;3371 3372 $implIncludes{"V8$type.h"}=1;3373 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1;3374 3375 my $nativeType = GetNativeType($type);3376 return "V8SVGStaticPODTypeWrapper<$nativeType>::create($value)";3377 3182 } 3378 3183 … … 3427 3232 return 0 unless $implClassName =~ /SVG/; 3428 3233 return 0 if $implClassName =~ /Element/; 3429 return 0 if $codeGenerator->IsSVG NewStyleAnimatedType($implClassName);3234 return 0 if $codeGenerator->IsSVGAnimatedType($implClassName); 3430 3235 return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); 3431 3236 … … 3456 3261 my $indent = shift; 3457 3262 3458 my $srcIsPodType = IsPodType($srcType); 3459 3460 my $srcObject = "imp"; 3461 if ($srcIsPodType) { 3462 $srcObject = "impWrapper"; 3463 } 3464 3465 my $contextDecl; 3466 3263 my $contextDecl = "imp"; 3467 3264 if (IsSVGTypeNeedingContextParameter($srcType)) { 3468 $contextDecl = "V8Proxy::svgContext($srcObject)"; 3469 } else { 3470 $contextDecl = $srcObject; 3265 $contextDecl = "V8Proxy::svgContext($contextDecl)"; 3471 3266 } 3472 3267 … … 3484 3279 return 1 if $functionName eq "removeItem"; 3485 3280 return 1 if $functionName eq "appendItem"; 3486 3487 return 0;3488 }3489 3490 sub IsSVGListMethod3491 {3492 my $functionName = shift;3493 3494 return 1 if $functionName eq "getFirst";3495 return 1 if $functionName eq "getLast";3496 return 1 if $functionName eq "getItem";3497 3498 return IsSVGListMutator($functionName);3499 }3500 3501 sub IsSVGListTypeNeedingSpecialHandling3502 {3503 my $className = shift;3504 3505 return 1 if $className eq "SVGTransformList";3506 3281 3507 3282 return 0; -
trunk/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
r71227 r71802 23 23 24 24 #if ENABLE(SVG) 25 #include "PlatformString.h"26 #include "SVGTransformList.h"27 25 26 // FIXME: Remove this file! 28 27 namespace WebCore { 29 28 … … 31 30 struct DeprecatedSVGAnimatedPropertyTraits : public Noncopyable { }; 32 31 33 // SVGAnimatedTransformList34 template<>35 struct DeprecatedSVGAnimatedPropertyTraits<SVGTransformList*> : public Noncopyable {36 typedef SVGTransformList* PassType;37 typedef SVGTransformList* ReturnType;38 typedef RefPtr<SVGTransformList> StoredType;39 40 static ReturnType null() { return 0; }41 static ReturnType toReturnType(const StoredType& type) { return type.get(); }42 static String toString(PassType type) { return type ? type->valueAsString() : String(); }43 };44 45 32 } 46 33 -
trunk/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
r71227 r71802 28 28 #include <wtf/HashMap.h> 29 29 30 // FIXME: Remove this file! 30 31 namespace WebCore { 31 32 32 33 class SVGElement; 33 class SVGTransformList;34 34 35 35 struct DeprecatedSVGAnimatedTypeWrapperKey { … … 152 152 } 153 153 154 // Common type definitions, to ease IDL generation.155 typedef DeprecatedSVGAnimatedTemplate<SVGTransformList*> SVGAnimatedTransformList;156 157 154 } 158 155 -
trunk/WebCore/svg/SVGAnimateTransformElement.cpp
r66498 r71802 87 87 88 88 89 static PassRefPtr<SVGTransformList>transformListFor(SVGElement* element)89 static SVGTransformList* transformListFor(SVGElement* element) 90 90 { 91 91 ASSERT(element); 92 92 if (element->isStyledTransformable()) 93 return static_cast<SVGStyledTransformableElement*>(element)->transform();93 return &static_cast<SVGStyledTransformableElement*>(element)->transform(); 94 94 if (element->hasTagName(SVGNames::textTag)) 95 return static_cast<SVGTextElement*>(element)->transform();95 return &static_cast<SVGTextElement*>(element)->transform(); 96 96 if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTagName(SVGNames::radialGradientTag)) 97 return static_cast<SVGGradientElement*>(element)->gradientTransform(); 97 return &static_cast<SVGGradientElement*>(element)->gradientTransform(); 98 // FIXME: Handle patternTransform, which is obviously missing! 98 99 return 0; 99 100 } … … 110 111 111 112 if (baseValue.isEmpty()) { 112 ExceptionCode ec; 113 RefPtr<SVGTransformList> list = transformListFor(targetElement()); 114 list->clear(ec); 113 if (SVGTransformList* list = transformListFor(targetElement())) 114 list->clear(); 115 115 } else 116 116 targetElement()->setAttribute(SVGNames::transformAttr, baseValue); … … 122 122 return; 123 123 SVGElement* targetElement = resultElement->targetElement(); 124 RefPtr<SVGTransformList>transformList = transformListFor(targetElement);124 SVGTransformList* transformList = transformListFor(targetElement); 125 125 ASSERT(transformList); 126 126 127 ExceptionCode ec;128 127 if (!isAdditive()) 129 transformList->clear( ec);128 transformList->clear(); 130 129 if (isAccumulated() && repeat) { 131 130 SVGTransform accumulatedTransform = SVGTransformDistance(m_fromTransform, m_toTransform).scaledDistance(repeat).addToSVGTransform(SVGTransform()); 132 transformList->append Item(accumulatedTransform, ec);131 transformList->append(accumulatedTransform); 133 132 } 134 133 SVGTransform transform = SVGTransformDistance(m_fromTransform, m_toTransform).scaledDistance(percentage).addToSVGTransform(m_fromTransform); 135 transformList->append Item(transform, ec);134 transformList->append(transform); 136 135 } 137 136 … … 182 181 183 182 // ...except in case where we have additional instances in <use> trees. 183 SVGTransformList* transformList = transformListFor(targetElement); 184 if (!transformList) 185 return; 186 184 187 const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement(); 185 RefPtr<SVGTransformList> transformList = transformListFor(targetElement);186 188 const HashSet<SVGElementInstance*>::const_iterator end = instances.end(); 187 189 for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) { … … 189 191 ASSERT(shadowTreeElement); 190 192 if (shadowTreeElement->isStyledTransformable()) 191 static_cast<SVGStyledTransformableElement*>(shadowTreeElement)->setTransformBaseValue( transformList.get());193 static_cast<SVGStyledTransformableElement*>(shadowTreeElement)->setTransformBaseValue(*transformList); 192 194 else if (shadowTreeElement->hasTagName(SVGNames::textTag)) 193 static_cast<SVGTextElement*>(shadowTreeElement)->setTransformBaseValue( transformList.get());195 static_cast<SVGTextElement*>(shadowTreeElement)->setTransformBaseValue(*transformList); 194 196 else if (shadowTreeElement->hasTagName(SVGNames::linearGradientTag) || shadowTreeElement->hasTagName(SVGNames::radialGradientTag)) 195 static_cast<SVGGradientElement*>(shadowTreeElement)->setGradientTransformBaseValue(transformList.get()); 197 static_cast<SVGGradientElement*>(shadowTreeElement)->setGradientTransformBaseValue(*transformList); 198 // FIXME: Handle patternTransform, obviously missing! 196 199 if (RenderObject* renderer = shadowTreeElement->renderer()) { 197 200 renderer->setNeedsTransformUpdate(); -
trunk/WebCore/svg/SVGGradientElement.cpp
r69279 r71802 42 42 : SVGStyledElement(tagName, document) 43 43 , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) 44 , m_gradientTransform(SVGTransformList::create(SVGNames::gradientTransformAttr))45 44 { 46 45 } … … 54 53 setGradientUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); 55 54 } else if (attr->name() == SVGNames::gradientTransformAttr) { 56 SVGTransformList* gradientTransforms = gradientTransformBaseValue(); 57 if (!SVGTransformable::parseTransformAttribute(gradientTransforms, attr->value())) { 58 ExceptionCode ec = 0; 59 gradientTransforms->clear(ec); 60 } 55 SVGTransformList newList; 56 if (!SVGTransformable::parseTransformAttribute(newList, attr->value())) 57 newList.clear(); 58 59 detachAnimatedGradientTransformListWrappers(newList.size()); 60 gradientTransformBaseValue() = newList; 61 61 } else if (attr->name() == SVGNames::spreadMethodAttr) { 62 62 if (attr->value() == "reflect") -
trunk/WebCore/svg/SVGGradientElement.h
r71227 r71802 25 25 #include "Gradient.h" 26 26 #include "SVGAnimatedPropertyMacros.h" 27 #include "SVGAnimatedTransformList.h" 27 28 #include "SVGExternalResourcesRequired.h" 28 29 #include "SVGStyledElement.h" … … 52 53 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::spreadMethodAttr, int, SpreadMethod, spreadMethod) 53 54 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::gradientUnitsAttr, int, GradientUnits, gradientUnits) 54 DECLARE_ANIMATED_ PROPERTY(SVGGradientElement, SVGNames::gradientTransformAttr, SVGTransformList*, GradientTransform, gradientTransform)55 DECLARE_ANIMATED_TRANSFORM_LIST_PROPERTY_NEW(SVGGradientElement, SVGNames::gradientTransformAttr, SVGTransformList, GradientTransform, gradientTransform) 55 56 56 57 // SVGURIReference -
trunk/WebCore/svg/SVGLinearGradientElement.cpp
r69413 r71802 128 128 attributes.setBoundingBoxMode(current->gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); 129 129 130 if (!attributes.hasGradientTransform() && current->hasAttribute(SVGNames::gradientTransformAttr)) 131 attributes.setGradientTransform(current->gradientTransform()->consolidate().matrix()); 130 if (!attributes.hasGradientTransform() && current->hasAttribute(SVGNames::gradientTransformAttr)) { 131 AffineTransform transform; 132 current->gradientTransform().concatenate(transform); 133 attributes.setGradientTransform(transform); 134 } 132 135 133 136 if (!attributes.hasStops()) { -
trunk/WebCore/svg/SVGMatrix.idl
r64579 r71802 23 23 module svg { 24 24 25 interface [Conditional=SVG , PODType=AffineTransform] SVGMatrix {25 interface [Conditional=SVG] SVGMatrix { 26 26 // FIXME: these attributes should all be floats but since we implement 27 27 // AffineTransform with doubles setting these as doubles makes more sense. 28 attribute double a;29 attribute double b;30 attribute double c;31 attribute double d;32 attribute double e;33 attribute double f;28 attribute [StrictTypeChecking] double a; 29 attribute [StrictTypeChecking] double b; 30 attribute [StrictTypeChecking] double c; 31 attribute [StrictTypeChecking] double d; 32 attribute [StrictTypeChecking] double e; 33 attribute [StrictTypeChecking] double f; 34 34 35 [ Custom] SVGMatrix multiply(in SVGMatrix secondMatrix);36 [Custom]SVGMatrix inverse()35 [StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix multiply(in SVGMatrix secondMatrix); 36 SVGMatrix inverse() 37 37 raises(SVGException); 38 [Immutable ] SVGMatrix translate(in float x, in float y);39 [Immutable ] SVGMatrix scale(in float scaleFactor);40 [Immutable ] SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY);41 [Immutable ] SVGMatrix rotate(in float angle);42 [ Custom] SVGMatrix rotateFromVector(in float x, in float y)38 [Immutable, StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix translate(in float x, in float y); 39 [Immutable, StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix scale(in float scaleFactor); 40 [Immutable, StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY); 41 [Immutable, StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix rotate(in float angle); 42 [StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix rotateFromVector(in float x, in float y) 43 43 raises(SVGException); 44 44 [Immutable] SVGMatrix flipX(); 45 45 [Immutable] SVGMatrix flipY(); 46 [Immutable ] SVGMatrix skewX(in float angle);47 [Immutable ] SVGMatrix skewY(in float angle);46 [Immutable, StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix skewX(in float angle); 47 [Immutable, StrictTypeChecking, RequiresAllArguments=Raise] SVGMatrix skewY(in float angle); 48 48 }; 49 49 -
trunk/WebCore/svg/SVGPatternElement.cpp
r69413 r71802 58 58 , m_patternUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) 59 59 , m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) 60 , m_patternTransform(SVGTransformList::create(SVGNames::patternTransformAttr))61 60 { 62 61 } … … 80 79 setPatternContentUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); 81 80 } else if (attr->name() == SVGNames::patternTransformAttr) { 82 SVGTransformList* patternTransforms = patternTransformBaseValue(); 83 if (!SVGTransformable::parseTransformAttribute(patternTransforms, attr->value())) { 84 ExceptionCode ec = 0; 85 patternTransforms->clear(ec); 86 } 81 SVGTransformList newList; 82 if (!SVGTransformable::parseTransformAttribute(newList, attr->value())) 83 newList.clear(); 84 85 detachAnimatedPatternTransformListWrappers(newList.size()); 86 patternTransformBaseValue() = newList; 87 87 } else if (attr->name() == SVGNames::xAttr) 88 88 setXBaseValue(SVGLength(LengthModeWidth, attr->value())); … … 225 225 attributes.setBoundingBoxModeContent(current->patternContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); 226 226 227 if (!attributes.hasPatternTransform() && current->hasAttribute(SVGNames::patternTransformAttr)) 228 attributes.setPatternTransform(current->patternTransform()->consolidate().matrix()); 227 if (!attributes.hasPatternTransform() && current->hasAttribute(SVGNames::patternTransformAttr)) { 228 AffineTransform transform; 229 current->patternTransform().concatenate(transform); 230 attributes.setPatternTransform(transform); 231 } 229 232 230 233 if (!attributes.hasPatternContentElement() && current->hasChildNodes()) -
trunk/WebCore/svg/SVGPatternElement.h
r71227 r71802 25 25 #include "SVGAnimatedLength.h" 26 26 #include "SVGAnimatedPropertyMacros.h" 27 #include "SVGAnimatedTransformList.h" 27 28 #include "SVGExternalResourcesRequired.h" 28 29 #include "SVGFitToViewBox.h" … … 71 72 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::patternUnitsAttr, int, PatternUnits, patternUnits) 72 73 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::patternContentUnitsAttr, int, PatternContentUnits, patternContentUnits) 73 DECLARE_ANIMATED_ PROPERTY(SVGPatternElement, SVGNames::patternTransformAttr, SVGTransformList*, PatternTransform, patternTransform)74 DECLARE_ANIMATED_TRANSFORM_LIST_PROPERTY_NEW(SVGPatternElement, SVGNames::patternTransformAttr, SVGTransformList, PatternTransform, patternTransform) 74 75 75 76 // SVGURIReference -
trunk/WebCore/svg/SVGPoint.idl
r71512 r71802 27 27 attribute [StrictTypeChecking] float y; 28 28 29 SVGPoint matrixTransform(in SVGMatrix matrix);29 [StrictTypeChecking, RequiresAllArguments=Raise] SVGPoint matrixTransform(in SVGMatrix matrix); 30 30 }; 31 31 -
trunk/WebCore/svg/SVGRadialGradientElement.cpp
r69413 r71802 138 138 attributes.setBoundingBoxMode(current->gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); 139 139 140 if (!attributes.hasGradientTransform() && current->hasAttribute(SVGNames::gradientTransformAttr)) 141 attributes.setGradientTransform(current->gradientTransform()->consolidate().matrix()); 140 if (!attributes.hasGradientTransform() && current->hasAttribute(SVGNames::gradientTransformAttr)) { 141 AffineTransform transform; 142 current->gradientTransform().concatenate(transform); 143 attributes.setGradientTransform(transform); 144 } 142 145 143 146 if (!attributes.hasStops()) { -
trunk/WebCore/svg/SVGSVGElement.cpp
r71772 r71802 450 450 } 451 451 452 AffineTransformSVGSVGElement::createSVGMatrix()453 { 454 return AffineTransform();452 SVGMatrix SVGSVGElement::createSVGMatrix() 453 { 454 return SVGMatrix(); 455 455 } 456 456 … … 465 465 } 466 466 467 SVGTransform SVGSVGElement::createSVGTransformFromMatrix(const AffineTransform& matrix)468 { 469 return SVGTransform( matrix);467 SVGTransform SVGSVGElement::createSVGTransformFromMatrix(const SVGMatrix& matrix) 468 { 469 return SVGTransform(static_cast<const AffineTransform&>(matrix)); 470 470 } 471 471 … … 583 583 584 584 AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(viewBoxRect, preserveAspectRatio(), viewWidth, viewHeight); 585 if (useCurrentView() && currentView()) 586 return currentView()->transform()->concatenate().matrix() * ctm; 585 if (useCurrentView() && currentView()) { 586 AffineTransform transform; 587 if (!currentView()->transform().concatenate(transform)) 588 return ctm; 589 590 return transform * ctm; 591 } 587 592 588 593 return ctm; -
trunk/WebCore/svg/SVGSVGElement.h
r71772 r71802 36 36 class SVGAngle; 37 37 class SVGLength; 38 class SVGMatrix; 38 39 class SVGTransform; 39 40 class SVGViewSpec; … … 109 110 static SVGAngle createSVGAngle(); 110 111 static FloatPoint createSVGPoint(); 111 static AffineTransformcreateSVGMatrix();112 static SVGMatrix createSVGMatrix(); 112 113 static FloatRect createSVGRect(); 113 114 static SVGTransform createSVGTransform(); 114 static SVGTransform createSVGTransformFromMatrix(const AffineTransform&);115 static SVGTransform createSVGTransformFromMatrix(const SVGMatrix&); 115 116 116 117 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const; -
trunk/WebCore/svg/SVGStyledTransformableElement.cpp
r71314 r71802 35 35 SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document* document) 36 36 : SVGStyledLocatableElement(tagName, document) 37 , m_transform(SVGTransformList::create(SVGNames::transformAttr))38 37 { 39 38 } … … 55 54 AffineTransform SVGStyledTransformableElement::animatedLocalTransform() const 56 55 { 57 return m_supplementalTransform ? *m_supplementalTransform * transform()->concatenate().matrix() : transform()->concatenate().matrix(); 56 AffineTransform matrix; 57 transform().concatenate(matrix); 58 return m_supplementalTransform ? *m_supplementalTransform * matrix : matrix; 58 59 } 59 60 60 61 AffineTransform* SVGStyledTransformableElement::supplementalTransform() 61 62 { … … 68 69 { 69 70 if (SVGTransformable::isKnownAttribute(attr->name())) { 70 SVGTransformList * localTransforms = transformBaseValue();71 if (!SVGTransformable::parseTransformAttribute( localTransforms, attr->value())) {72 ExceptionCode ec = 0;73 localTransforms->clear(ec);74 }71 SVGTransformList newList; 72 if (!SVGTransformable::parseTransformAttribute(newList, attr->value())) 73 newList.clear(); 74 detachAnimatedTransformListWrappers(newList.size()); 75 transformBaseValue() = newList; 75 76 } else 76 77 SVGStyledLocatableElement::parseMappedAttribute(attr); -
trunk/WebCore/svg/SVGStyledTransformableElement.h
r71103 r71802 61 61 virtual void synchronizeProperty(const QualifiedName&); 62 62 63 DECLARE_ANIMATED_ PROPERTY(SVGStyledTransformableElement, SVGNames::transformAttr, SVGTransformList*, Transform, transform)63 DECLARE_ANIMATED_TRANSFORM_LIST_PROPERTY_NEW(SVGStyledTransformableElement, SVGNames::transformAttr, SVGTransformList, Transform, transform) 64 64 65 65 private: -
trunk/WebCore/svg/SVGTextElement.cpp
r71726 r71802 39 39 : SVGTextPositioningElement(tagName, doc) 40 40 , SVGTransformable() 41 , m_transform(SVGTransformList::create(SVGNames::transformAttr))42 41 { 43 42 } … … 51 50 { 52 51 if (SVGTransformable::isKnownAttribute(attr->name())) { 53 SVGTransformList* localTransforms = transformBaseValue(); 54 if (!SVGTransformable::parseTransformAttribute(localTransforms, attr->value())) { 55 ExceptionCode ec = 0; 56 localTransforms->clear(ec); 57 } 52 SVGTransformList newList; 53 if (!SVGTransformable::parseTransformAttribute(newList, attr->value())) 54 newList.clear(); 55 56 detachAnimatedTransformListWrappers(newList.size()); 57 transformBaseValue() = newList; 58 58 } else 59 59 SVGTextPositioningElement::parseMappedAttribute(attr); … … 87 87 AffineTransform SVGTextElement::animatedLocalTransform() const 88 88 { 89 return m_supplementalTransform ? *m_supplementalTransform * transform()->concatenate().matrix() : transform()->concatenate().matrix(); 89 AffineTransform matrix; 90 transform().concatenate(matrix); 91 return m_supplementalTransform ? *m_supplementalTransform * matrix : matrix; 90 92 } 91 93 -
trunk/WebCore/svg/SVGTextElement.h
r66397 r71802 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedTransformList.h" 25 26 #include "SVGTextPositioningElement.h" 26 27 #include "SVGTransformable.h" … … 55 56 virtual void synchronizeProperty(const QualifiedName&); 56 57 57 DECLARE_ANIMATED_ PROPERTY(SVGTextElement, SVGNames::transformAttr, SVGTransformList*, Transform, transform)58 DECLARE_ANIMATED_TRANSFORM_LIST_PROPERTY_NEW(SVGTextElement, SVGNames::transformAttr, SVGTransformList, Transform, transform) 58 59 59 60 // Used by <animateMotion> -
trunk/WebCore/svg/SVGTransform.cpp
r66397 r71802 20 20 21 21 #include "config.h" 22 22 23 #if ENABLE(SVG) 23 24 24 #include "FloatPoint.h" 25 25 #include "FloatSize.h" … … 28 28 #include "SVGTransform.h" 29 29 30 #include < math.h>30 #include <wtf/MathExtras.h> 31 31 32 using namespace WebCore; 32 namespace WebCore { 33 33 34 34 SVGTransform::SVGTransform() … … 41 41 : m_type(type) 42 42 , m_angle(0) 43 , m_center(FloatPoint())44 , m_matrix(AffineTransform())45 43 { 46 44 } … … 53 51 } 54 52 55 bool SVGTransform::isValid() 56 { 57 return (m_type != SVG_TRANSFORM_UNKNOWN); 58 } 59 60 SVGTransform::SVGTransformType SVGTransform::type() const 61 { 62 return m_type; 63 } 64 65 AffineTransform SVGTransform::matrix() const 66 { 67 return m_matrix; 68 } 69 70 float SVGTransform::angle() const 71 { 72 return m_angle; 73 } 74 75 FloatPoint SVGTransform::rotationCenter() const 76 { 77 return m_center; 78 } 79 80 void SVGTransform::setMatrix(AffineTransform matrix) 53 void SVGTransform::setMatrix(const AffineTransform& matrix) 81 54 { 82 55 m_type = SVG_TRANSFORM_MATRIX; 83 56 m_angle = 0; 57 m_matrix = matrix; 58 } 84 59 85 m_matrix = matrix; 60 void SVGTransform::updateMatrix() 61 { 62 // The underlying matrix has been changed, alter the transformation type. 63 // Spec: In case the matrix object is changed directly (i.e., without using the methods on the SVGTransform interface itself) 64 // then the type of the SVGTransform changes to SVG_TRANSFORM_MATRIX. 65 m_type = SVG_TRANSFORM_MATRIX; 66 m_angle = 0; 86 67 } 87 68 … … 146 127 } 147 128 129 } // namespace WebCore 130 148 131 #endif // ENABLE(SVG) 149 -
trunk/WebCore/svg/SVGTransform.h
r66397 r71802 23 23 24 24 #if ENABLE(SVG) 25 #include "AffineTransform.h"26 25 #include "FloatPoint.h" 26 #include "SVGMatrix.h" 27 27 28 28 namespace WebCore { 29 30 class FloatSize; 31 32 class SVGTransform { 33 public: 34 enum SVGTransformType { 35 SVG_TRANSFORM_UNKNOWN = 0, 36 SVG_TRANSFORM_MATRIX = 1, 37 SVG_TRANSFORM_TRANSLATE = 2, 38 SVG_TRANSFORM_SCALE = 3, 39 SVG_TRANSFORM_ROTATE = 4, 40 SVG_TRANSFORM_SKEWX = 5, 41 SVG_TRANSFORM_SKEWY = 6 42 }; 43 44 SVGTransform(); 45 SVGTransform(SVGTransformType); 46 explicit SVGTransform(const AffineTransform&); 47 48 SVGTransformType type() const { return m_type; } 49 50 SVGMatrix& svgMatrix() { return static_cast<SVGMatrix&>(m_matrix); } 51 AffineTransform matrix() const { return m_matrix; } 52 void updateMatrix(); 53 54 float angle() const { return m_angle; } 55 FloatPoint rotationCenter() const { return m_center; } 56 57 void setMatrix(const AffineTransform&); 58 void setTranslate(float tx, float ty); 59 void setScale(float sx, float sy); 60 void setRotate(float angle, float cx, float cy); 61 void setSkewX(float angle); 62 void setSkewY(float angle); 29 63 30 class FloatSize; 64 // Internal use only (animation system) 65 FloatPoint translate() const; 66 FloatSize scale() const; 31 67 32 class SVGTransform { 33 public: 34 enum SVGTransformType { 35 SVG_TRANSFORM_UNKNOWN = 0, 36 SVG_TRANSFORM_MATRIX = 1, 37 SVG_TRANSFORM_TRANSLATE = 2, 38 SVG_TRANSFORM_SCALE = 3, 39 SVG_TRANSFORM_ROTATE = 4, 40 SVG_TRANSFORM_SKEWX = 5, 41 SVG_TRANSFORM_SKEWY = 6 42 }; 43 44 SVGTransform(); 45 SVGTransform(SVGTransformType); 46 explicit SVGTransform(const AffineTransform&); 68 bool isValid() const { return m_type != SVG_TRANSFORM_UNKNOWN; } 47 69 48 SVGTransformType type() const; 70 private: 71 friend bool operator==(const SVGTransform& a, const SVGTransform& b); 49 72 50 AffineTransform matrix() const; 51 52 float angle() const; 53 FloatPoint rotationCenter() const; 73 SVGTransformType m_type; 74 float m_angle; 75 FloatPoint m_center; 76 AffineTransform m_matrix; 77 }; 54 78 55 void setMatrix(AffineTransform); 79 inline bool operator==(const SVGTransform& a, const SVGTransform& b) 80 { 81 return a.m_type == b.m_type && a.m_angle == b.m_angle && a.m_matrix == b.m_matrix; 82 } 56 83 57 void setTranslate(float tx, float ty); 58 void setScale(float sx, float sy); 59 void setRotate(float angle, float cx, float cy); 60 void setSkewX(float angle); 61 void setSkewY(float angle); 62 63 // Internal use only (animation system) 64 FloatPoint translate() const; 65 FloatSize scale() const; 66 67 bool isValid(); 84 inline bool operator!=(const SVGTransform& a, const SVGTransform& b) 85 { 86 return !(a == b); 87 } 68 88 69 private:70 SVGTransformType m_type;71 float m_angle;72 FloatPoint m_center;73 AffineTransform m_matrix;74 };75 76 inline bool operator==(const SVGTransform& a, const SVGTransform& b)77 {78 return a.type() == b.type() && a.angle() == b.angle() && a.matrix() == b.matrix();79 }80 81 inline bool operator!=(const SVGTransform& a, const SVGTransform& b)82 {83 return !(a == b);84 }85 86 89 } // namespace WebCore 87 90 -
trunk/WebCore/svg/SVGTransform.idl
r64579 r71802 22 22 module svg { 23 23 24 interface [Conditional=SVG , PODType=SVGTransform] SVGTransform {24 interface [Conditional=SVG] SVGTransform { 25 25 // Transform Types 26 const unsigned short SVG_TRANSFORM_UNKNOWN 27 const unsigned short SVG_TRANSFORM_MATRIX 26 const unsigned short SVG_TRANSFORM_UNKNOWN = 0; 27 const unsigned short SVG_TRANSFORM_MATRIX = 1; 28 28 const unsigned short SVG_TRANSFORM_TRANSLATE = 2; 29 const unsigned short SVG_TRANSFORM_SCALE 30 const unsigned short SVG_TRANSFORM_ROTATE 31 const unsigned short SVG_TRANSFORM_SKEWX 32 const unsigned short SVG_TRANSFORM_SKEWY 29 const unsigned short SVG_TRANSFORM_SCALE = 3; 30 const unsigned short SVG_TRANSFORM_ROTATE = 4; 31 const unsigned short SVG_TRANSFORM_SKEWX = 5; 32 const unsigned short SVG_TRANSFORM_SKEWY = 6; 33 33 34 34 readonly attribute unsigned short type; … … 36 36 readonly attribute float angle; 37 37 38 void setMatrix(in SVGMatrix matrix);39 void setTranslate(in float tx, in float ty);40 void setScale(in float sx, in float sy);41 void setRotate(in float angle, in float cx, in float cy);42 void setSkewX(in float angle);43 void setSkewY(in float angle);38 [StrictTypeChecking, RequiresAllArguments=Raise] void setMatrix(in SVGMatrix matrix); 39 [StrictTypeChecking, RequiresAllArguments=Raise] void setTranslate(in float tx, in float ty); 40 [StrictTypeChecking, RequiresAllArguments=Raise] void setScale(in float sx, in float sy); 41 [StrictTypeChecking, RequiresAllArguments=Raise] void setRotate(in float angle, in float cx, in float cy); 42 [StrictTypeChecking, RequiresAllArguments=Raise] void setSkewX(in float angle); 43 [StrictTypeChecking, RequiresAllArguments=Raise] void setSkewY(in float angle); 44 44 }; 45 45 -
trunk/WebCore/svg/SVGTransformList.cpp
r64579 r71802 27 27 #include "SVGSVGElement.h" 28 28 #include "SVGTransform.h" 29 #include <wtf/text/StringConcatenate.h> 30 #include <wtf/text/StringBuilder.h> 29 31 30 using namespace WebCore; 32 namespace WebCore { 31 33 32 SVGTransformList::SVGTransformList(const QualifiedName& attributeName) 33 : SVGPODList<SVGTransform>(attributeName) 34 { 35 } 36 37 SVGTransformList::~SVGTransformList() 38 { 39 } 40 41 SVGTransform SVGTransformList::createSVGTransformFromMatrix(const AffineTransform& matrix) const 34 SVGTransform SVGTransformList::createSVGTransformFromMatrix(const SVGMatrix& matrix) const 42 35 { 43 36 return SVGSVGElement::createSVGTransformFromMatrix(matrix); … … 46 39 SVGTransform SVGTransformList::consolidate() 47 40 { 48 ExceptionCode ec = 0; 49 return initialize(concatenate(), ec); 41 AffineTransform matrix; 42 if (!concatenate(matrix)) 43 return SVGTransform(); 44 45 SVGTransform transform(matrix); 46 clear(); 47 append(transform); 48 return transform; 50 49 } 51 50 52 SVGTransform SVGTransformList::concatenate() const51 bool SVGTransformList::concatenate(AffineTransform& result) const 53 52 { 54 unsigned int length = numberOfItems(); 55 if (!length) 56 return SVGTransform(); 57 58 AffineTransform matrix; 59 ExceptionCode ec = 0; 60 for (unsigned int i = 0; i < length; i++) 61 matrix = getItem(i, ec).matrix() * matrix; 53 unsigned size = this->size(); 54 if (!size) 55 return false; 62 56 63 return SVGTransform(matrix); 57 for (unsigned i = 0; i < size; ++i) 58 result = at(i).matrix() * result; 59 60 return true; 64 61 } 65 62 … … 67 64 { 68 65 // TODO: We may want to build a real transform string, instead of concatting to a matrix(...). 69 SVGTransform transform = concatenate(); 70 if (transform.type() == SVGTransform::SVG_TRANSFORM_MATRIX) { 71 AffineTransform matrix = transform.matrix(); 72 return String::format("matrix(%f %f %f %f %f %f)", matrix.a(), matrix.b(), matrix.c(), matrix.d(), matrix.e(), matrix.f()); 73 } 66 AffineTransform matrix; 67 concatenate(matrix); 74 68 75 return String(); 69 StringBuilder builder; 70 builder.append(makeString("matrix(", String::number(matrix.a()), ' ', String::number(matrix.b()), ' ', String::number(matrix.c()), ' ')); 71 builder.append(makeString(String::number(matrix.d()), ' ', String::number(matrix.e()), ' ', String::number(matrix.f()), ')')); 72 return builder.toString(); 76 73 } 77 74 75 } // namespace WebCore 76 78 77 #endif // ENABLE(SVG) -
trunk/WebCore/svg/SVGTransformList.h
r65021 r71802 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGList.h"26 25 #include "SVGTransform.h" 27 #include <wtf/ Forward.h>28 #include <wtf/ PassRefPtr.h>26 #include <wtf/Vector.h> 27 #include <wtf/text/WTFString.h> 29 28 30 29 namespace WebCore { 31 30 32 class SVGTransformList : public SVGPODList<SVGTransform> { 33 public: 34 static PassRefPtr<SVGTransformList> create(const QualifiedName& attributeName) { return adoptRef(new SVGTransformList(attributeName)); } 35 virtual ~SVGTransformList(); 31 class SVGTransformList : public Vector<SVGTransform> { 32 public: 33 SVGTransformList() { } 36 34 37 SVGTransform createSVGTransformFromMatrix(const AffineTransform&) const;38 35 SVGTransform createSVGTransformFromMatrix(const SVGMatrix&) const; 36 SVGTransform consolidate(); 39 37 40 41 SVGTransform concatenate() const;38 // Internal use only 39 bool concatenate(AffineTransform& result) const; 42 40 43 String valueAsString() const; 44 45 private: 46 SVGTransformList(const QualifiedName&); 47 }; 41 String valueAsString() const; 42 }; 48 43 49 44 } // namespace WebCore -
trunk/WebCore/svg/SVGTransformList.idl
r64579 r71802 32 32 void clear() 33 33 raises(DOMException); 34 SVGTransform initialize(in SVGTransform item)34 [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform initialize(in SVGTransform item) 35 35 raises(DOMException, SVGException); 36 SVGTransform getItem(in unsigned long index)36 [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform getItem(in unsigned long index) 37 37 raises(DOMException); 38 SVGTransform insertItemBefore(in SVGTransform item, in unsigned long index)38 [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform insertItemBefore(in SVGTransform item, in unsigned long index) 39 39 raises(DOMException, SVGException); 40 SVGTransform replaceItem(in SVGTransform item, in unsigned long index)40 [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform replaceItem(in SVGTransform item, in unsigned long index) 41 41 raises(DOMException, SVGException); 42 SVGTransform removeItem(in unsigned long index)42 [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform removeItem(in unsigned long index) 43 43 raises(DOMException); 44 SVGTransform appendItem(in SVGTransform item)44 [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform appendItem(in SVGTransform item) 45 45 raises(DOMException, SVGException); 46 SVGTransform createSVGTransformFromMatrix(in SVGMatrix matrix); 47 SVGTransform consolidate(); 46 47 [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform createSVGTransformFromMatrix(in SVGMatrix matrix); 48 SVGTransform consolidate() 49 raises(DOMException); 48 50 }; 49 51 -
trunk/WebCore/svg/SVGTransformable.cpp
r66397 r71802 90 90 static const int optionalValuesForType[] = {0, 0, 1, 1, 2, 0, 0}; 91 91 92 bool SVGTransformable::parseTransformValue(unsigned type, const UChar*& ptr, const UChar* end, SVGTransform& t )92 bool SVGTransformable::parseTransformValue(unsigned type, const UChar*& ptr, const UChar* end, SVGTransform& transform) 93 93 { 94 94 if (type == SVGTransform::SVG_TRANSFORM_UNKNOWN) … … 101 101 102 102 switch (type) { 103 104 t.setSkewX(values[0]);105 106 107 t.setSkewY(values[0]);108 109 110 111 t.setScale(values[0], values[0]);112 113 t.setScale(values[0], values[1]);114 115 116 117 t.setTranslate(values[0], 0);118 119 t.setTranslate(values[0], values[1]);120 121 122 123 t.setRotate(values[0], 0, 0);124 125 t.setRotate(values[0], values[1], values[2]);126 127 128 t.setMatrix(AffineTransform(values[0], values[1], values[2], values[3], values[4], values[5]));129 103 case SVGTransform::SVG_TRANSFORM_SKEWX: 104 transform.setSkewX(values[0]); 105 break; 106 case SVGTransform::SVG_TRANSFORM_SKEWY: 107 transform.setSkewY(values[0]); 108 break; 109 case SVGTransform::SVG_TRANSFORM_SCALE: 110 if (valueCount == 1) // Spec: if only one param given, assume uniform scaling 111 transform.setScale(values[0], values[0]); 112 else 113 transform.setScale(values[0], values[1]); 114 break; 115 case SVGTransform::SVG_TRANSFORM_TRANSLATE: 116 if (valueCount == 1) // Spec: if only one param given, assume 2nd param to be 0 117 transform.setTranslate(values[0], 0); 118 else 119 transform.setTranslate(values[0], values[1]); 120 break; 121 case SVGTransform::SVG_TRANSFORM_ROTATE: 122 if (valueCount == 1) 123 transform.setRotate(values[0], 0, 0); 124 else 125 transform.setRotate(values[0], values[1], values[2]); 126 break; 127 case SVGTransform::SVG_TRANSFORM_MATRIX: 128 transform.setMatrix(AffineTransform(values[0], values[1], values[2], values[3], values[4], values[5])); 129 break; 130 130 } 131 131 … … 166 166 } 167 167 168 bool SVGTransformable::parseTransformAttribute(SVGTransformList *list, const AtomicString& transform)168 bool SVGTransformable::parseTransformAttribute(SVGTransformList& list, const AtomicString& transform) 169 169 { 170 170 const UChar* start = transform.characters(); … … 172 172 } 173 173 174 bool SVGTransformable::parseTransformAttribute(SVGTransformList* list, const UChar*& currTransform, const UChar* end, TransformParsingMode mode) 175 { 176 ExceptionCode ec = 0; 177 if (mode == ClearList) { 178 list->clear(ec); 179 ASSERT(!ec); 180 } 174 bool SVGTransformable::parseTransformAttribute(SVGTransformList& list, const UChar*& currTransform, const UChar* end, TransformParsingMode mode) 175 { 176 if (mode == ClearList) 177 list.clear(); 181 178 182 179 bool delimParsed = false; … … 189 186 return false; 190 187 191 SVGTransform t ;192 if (!parseTransformValue(type, currTransform, end, t ))188 SVGTransform transform; 189 if (!parseTransformValue(type, currTransform, end, transform)) 193 190 return false; 194 191 195 list ->appendItem(t, ec);192 list.append(transform); 196 193 skipOptionalSpaces(currTransform, end); 197 194 if (currTransform < end && *currTransform == ',') { -
trunk/WebCore/svg/SVGTransformable.h
r66397 r71802 41 41 }; 42 42 43 static bool parseTransformAttribute(SVGTransformList *, const AtomicString& transform);44 static bool parseTransformAttribute(SVGTransformList *, const UChar*& ptr, const UChar* end, TransformParsingMode mode = ClearList);43 static bool parseTransformAttribute(SVGTransformList&, const AtomicString& transform); 44 static bool parseTransformAttribute(SVGTransformList&, const UChar*& ptr, const UChar* end, TransformParsingMode mode = ClearList); 45 45 static bool parseTransformValue(unsigned type, const UChar*& ptr, const UChar* end, SVGTransform&); 46 46 -
trunk/WebCore/svg/SVGViewSpec.cpp
r70631 r71802 34 34 SVGViewSpec::SVGViewSpec(SVGElement* contextElement) 35 35 : m_contextElement(contextElement) 36 , m_transform(SVGTransformList::create(SVGNames::transformAttr))37 36 { 38 37 } … … 40 39 void SVGViewSpec::setTransform(const String& transform) 41 40 { 42 SVGTransformable::parseTransformAttribute(m_transform .get(), transform);41 SVGTransformable::parseTransformAttribute(m_transform, transform); 43 42 } 44 43 … … 145 144 return false; 146 145 currViewSpec++; 147 SVGTransformable::parseTransformAttribute(m_transform .get(), currViewSpec, end, SVGTransformable::DoNotClearList);146 SVGTransformable::parseTransformAttribute(m_transform, currViewSpec, end, SVGTransformable::DoNotClearList); 148 147 if (currViewSpec >= end || *currViewSpec != ')') 149 148 return false; -
trunk/WebCore/svg/SVGViewSpec.h
r71103 r71802 43 43 44 44 void setTransform(const String&); 45 SVGTransformList * transform() const { return m_transform.get(); }45 SVGTransformList transform() const { return m_transform; } 46 46 47 47 void setViewBoxString(const String&); … … 62 62 DECLARE_ANIMATED_PROPERTY_NEW(SVGViewSpec, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 63 63 64 mutable RefPtr<SVGTransformList>m_transform;64 SVGTransformList m_transform; 65 65 String m_viewTargetString; 66 66 }; -
trunk/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
r71329 r71802 92 92 } 93 93 94 protected: 94 95 SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& values) 95 96 : SVGAnimatedProperty(contextElement, attributeName) … … 100 101 } 101 102 102 private:103 103 PropertyType& m_values; 104 104 -
trunk/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
r71227 r71802 28 28 #include "SVGAnimatedPropertySynchronizer.h" 29 29 #include "SVGAnimatedPropertyTearOff.h" 30 #include "SVGAnimatedTransformListPropertyTearOff.h" 30 31 #include "SVGNames.h" // FIXME: Temporary hack, until we expand the macros in all files, so we don't need a global SVGNames.h include 31 32 #include "SVGPropertyTraits.h" … … 157 158 } 158 159 160 #define DECLARE_ANIMATED_TRANSFORM_LIST_PROPERTY_NEW(OwnerType, DOMAttribute, PropertyType, UpperProperty, LowerProperty) \ 161 DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedTransformListPropertyTearOff, PropertyType, UpperProperty, LowerProperty) \ 162 \ 163 void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \ 164 { \ 165 SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \ 166 SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGAnimatedTransformListPropertyTearOff>(contextElement, DOMAttribute.localName()); \ 167 if (!wrapper) \ 168 return; \ 169 static_cast<SVGAnimatedTransformListPropertyTearOff*>(wrapper)->detachListWrappers(newListSize); \ 170 } 171 172 159 173 } 160 174 -
trunk/WebCore/svg/properties/SVGListPropertyTearOff.h
r71329 r71802 110 110 } 111 111 112 pr ivate:112 protected: 113 113 SVGListPropertyTearOff(AnimatedListPropertyTearOff* animatedProperty, SVGPropertyRole role) 114 114 : SVGListProperty<PropertyType>(role) … … 180 180 } 181 181 182 private:183 182 // Back pointer to the animated property that created us 184 183 // For example (text.x.baseVal): m_animatedProperty points to the 'x' SVGAnimatedLengthList object -
trunk/WebCore/svg/properties/SVGProperty.h
r70223 r71802 35 35 public: 36 36 virtual ~SVGProperty() { } 37 38 virtual void commitChange() = 0; 37 39 }; 38 40 -
trunk/WebCore/svg/properties/SVGPropertyTearOff.h
r71512 r71802 70 70 void detachWrapper() 71 71 { 72 if (m_valueIsCopy) 73 return; 74 72 75 // Switch from a live value, to a non-live value. 73 76 // For example: <text x="50"/> … … 77 80 // w/o changing the "new item" (with x=100) in the text element. 78 81 // Whenever the XML DOM modifies the "x" attribute, all existing wrappers are detached, using this function. 79 ASSERT(!m_valueIsCopy);80 82 m_value = new PropertyType(*m_value); 81 83 m_valueIsCopy = true; -
trunk/WebCore/svg/properties/SVGPropertyTraits.h
r71512 r71802 31 31 #include "SVGPreserveAspectRatio.h" 32 32 #include "SVGStringList.h" 33 #include "SVGTransformList.h" 33 34 #include <wtf/text/StringBuilder.h> 34 35 … … 131 132 }; 132 133 134 template<> 135 struct SVGPropertyTraits<SVGTransformList> { 136 static SVGTransformList initialValue() { return SVGTransformList(); } 137 static String toString(const SVGTransformList& type) { return type.valueAsString(); } 138 typedef SVGTransform ListItemType; 139 }; 140 133 141 } 134 142
Note: See TracChangeset
for help on using the changeset viewer.