Changeset 118735 in webkit
- Timestamp:
- May 29, 2012 1:41:58 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 11 deleted
- 58 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r118734 r118735 1 2012-05-29 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 SVGViewSpec DOM bindings aka SVGSVGElement.currentView is unimplemented 4 https://bugs.webkit.org/show_bug.cgi?id=15495 5 6 Reviewed by Rob Buis. 7 8 Re-enable a long disabled test for SVGViewSpec, and make it actually work. 9 Extend SVGViewSpec test coverage, and rebaseline results that changed due the SVGViewSpec constructor addition. 10 11 Make linking-a-03-b-all.svg a reftest, to avoid rebaselines on all platforms. 12 13 * platform/chromium-linux/svg/custom/linking-a-03-b-all-expected.png: Removed. 14 * platform/chromium-mac/svg/custom/linking-a-03-b-all-expected.png: Removed. 15 * platform/chromium-win/fast/js/global-constructors-expected.txt: 16 * platform/chromium-win/svg/custom/linking-a-03-b-all-expected.png: Removed. 17 * platform/chromium-win/svg/custom/linking-a-03-b-all-expected.txt: Removed. 18 * platform/gtk/fast/js/global-constructors-expected.txt: 19 * platform/gtk/svg/custom/linking-a-03-b-all-expected.png: Removed. 20 * platform/gtk/svg/custom/linking-a-03-b-all-expected.txt: Removed. 21 * platform/mac/fast/js/global-constructors-expected.txt: 22 * platform/mac/svg/custom/linking-a-03-b-all-expected.png: Removed. 23 * platform/mac/svg/custom/linking-a-03-b-all-expected.txt: Removed. 24 * platform/qt/fast/js/global-constructors-expected.txt: 25 * platform/qt/svg/custom/linking-a-03-b-all-expected.png: Removed. 26 * platform/qt/svg/custom/linking-a-03-b-all-expected.txt: Removed. 27 * platform/win/fast/js/global-constructors-expected.txt: 28 * svg/custom/global-constructors-expected.txt: 29 * svg/custom/linking-a-03-b-all-expected.svg: Added. 30 * svg/dom/SVGViewSpec-defaults-expected.txt: Added. 31 * svg/dom/SVGViewSpec-defaults.html: Added. 32 * svg/dom/SVGViewSpec-expected.txt: Added. 33 * svg/dom/SVGViewSpec.html: Added. 34 * svg/dom/complex-svgView-specification-expected.html: Added. 35 * svg/dom/complex-svgView-specification.html: Added. 36 * svg/dom/resources/viewspec-target.svg: Added. 37 * svg/dom/script-tests/SVGViewSpec-defaults.js: Added. 38 * svg/dom/script-tests/SVGViewSpec.js: Added. 39 (completeTest.script.onload): 40 (completeTest): 41 (testFragment): 42 (matrixToString): 43 (continueTesting): 44 * svg/dom/viewspec-parser-expected.txt: Added. 45 * svg/dom/viewspec-parser.html: Renamed from LayoutTests/svg/dom/viewspec-parser.html-disabled. 46 1 47 2012-05-29 Marcus Bulach <bulach@chromium.org> 2 48 -
trunk/LayoutTests/platform/chromium-win/fast/js/global-constructors-expected.txt
r113509 r118735 292 292 PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]' 293 293 PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]' 294 PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]' 295 PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]' 294 296 PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]' 295 297 PASS SharedWorker.toString() is '[object SharedWorkerConstructor]' -
trunk/LayoutTests/platform/gtk/fast/js/global-constructors-expected.txt
r118469 r118735 296 296 PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]' 297 297 PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]' 298 PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]' 298 299 PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]' 299 300 PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]' -
trunk/LayoutTests/platform/mac/fast/js/global-constructors-expected.txt
r118381 r118735 296 296 PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]' 297 297 PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]' 298 PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]' 298 299 PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]' 299 300 PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]' -
trunk/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt
r118362 r118735 283 283 PASS SVGUseElement.toString() is '[object SVGUseElementConstructor]' 284 284 PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]' 285 PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]' 285 286 PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]' 286 287 PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]' -
trunk/LayoutTests/platform/win/fast/js/global-constructors-expected.txt
r105514 r118735 292 292 PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]' 293 293 PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]' 294 PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]' 295 PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]' 294 296 PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]' 295 297 PASS SharedWorker.toString() is '[object SharedWorkerConstructor]' -
trunk/LayoutTests/svg/custom/global-constructors-expected.txt
r118353 r118735 33 33 FAIL SVGFitToViewBox.toString() should be [object SVGFitToViewBoxConstructor]. Threw exception ReferenceError: Can't find variable: SVGFitToViewBox 34 34 PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]' 35 FAIL SVGViewSpec.toString() should be [object SVGViewSpecConstructor]. Threw exception ReferenceError: Can't find variable: SVGViewSpec 35 PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]' 36 36 FAIL SVGURIReference.toString() should be [object SVGURIReferenceConstructor]. Threw exception ReferenceError: Can't find variable: SVGURIReference 37 37 FAIL SVGCSSRule.toString() should be [object SVGCSSRuleConstructor]. Threw exception ReferenceError: Can't find variable: SVGCSSRule -
trunk/LayoutTests/svg/dom/viewspec-parser.html
r118734 r118735 17 17 viewTarget: 1 18 18 }; 19 19 20 20 var preserveAspectRatioValues = [ "Min", "Max", "Mid" ]; 21 21 22 22 var testsToRun = [ 23 "svgView(viewBox(0,0,200,200)))", 24 "svgView(preserveAspectRatio(xMaxYMin slice))", 25 "svgView(preserveAspectRatio(xMaxYMin))", 26 "svgView(viewBox(1,2,3,4);preserveAspectRatio(xMaxYMin))", 27 "svgView(zoomAndPan(disable))", 28 "svgView(viewTarget(#myElementId))", 23 29 "svgView", 24 30 "svgView(", 25 31 "svgView()", 26 32 "svgView(" + String.fromCharCode(0), 27 "svgView(" + String.fromCharCode(0) + ")",28 33 "svgView(transform(scale(2));;)", 29 34 "svgView(transform(scale(2));x", // used to hang … … 32 37 "svgView(;;transform(scale(.5)))", 33 38 "svgView(transform(scale(.5));transform(scale(2));transform(scale(2)))", 39 34 40 ]; 35 36 41 37 42 var characters = [ 38 43 "0", … … 57 62 "," 58 63 ]; 59 64 60 65 function buildTestsToRun() { 61 66 for (var attribute in attributes) { 62 67 63 68 // Too few / too many arguments 64 for (var i = 0; i < 20; i++) { //>69 for (var i = 0; i < 5; i++) { //> 65 70 var attributeString = "svgView(" + attribute + "("; 66 71 for (var j = 0; j < i; j++) { //> … … 74 79 75 80 // Random assortments of valid characters 76 for (var i = 0; i < 100; i++) { //>81 for (var i = 0; i < 50; i++) { //> 77 82 var attributeString = "svgView(" + attribute + "("; 78 83 var count = Math.scriptedRandomInt(20); … … 82 87 testsToRun.push(attributeString); 83 88 } 84 89 85 90 // attribute names that are "off by one" 86 91 var extraChar = attribute.charAt(attribute.length - 1); 87 92 testsToRun.push("svgView(" + attribute + extraChar + "(0, 0)"); 88 93 testsToRun.push("svgView(" + attribute.substring(0, attribute.length - 1) + "(0, 0)"); 89 94 90 95 // Empty-ish attributes 91 96 testsToRun.push("svgView(" + attribute); 92 97 testsToRun.push("svgView(" + attribute + String.fromCharCode(0)); 93 testsToRun.push("svgView(" + attribute + "(" + String.fromCharCode(0) + ")");94 98 } 95 96 99 } 97 100 101 function zoomAndPanToString(zoomAndPan) 102 { 103 if (zoomAndPan == SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY) 104 return "magnify"; 105 if (zoomAndPan == SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE) 106 return "disable"; 107 return "unknown"; 108 } 109 98 110 function viewSpecToString(viewSpec) 99 111 { 100 112 if (!viewSpec) 101 return viewSpec;102 113 return undefined; 114 103 115 var attributes = []; 104 if (viewSpec.transform) 105 attributes.push("transform(" + viewSpec.transform + ")"); 106 if (viewSpec.viewBox) 107 attributes.push("viewBox(" + viewSpec.viewBox + ")"); 108 if (viewSpec.preserveAspectRatio) 109 attributes.push("preserveAspectRatio(" + viewSpec.preserveAspectRatio + ")"); 110 if (viewSpec.zoomAndPan) 111 attributes.push("zoomAndPan(" + viewSpec.zoomAndPan + ")"); 112 if (viewSpec.viewTarget) 113 attributes.push("viewTarget(" + viewSpac.viewTarget + ")"); 114 116 if (viewSpec.transformString) 117 attributes.push("transform(" + viewSpec.transformString + ")"); 118 if (viewSpec.viewBoxString && viewSpec.viewBoxString != "0 0 0 0") 119 attributes.push("viewBox(" + viewSpec.viewBoxString + ")"); 120 if (viewSpec.preserveAspectRatioString && viewSpec.preserveAspectRatioString != "xMidYMid meet") 121 attributes.push("preserveAspectRatio(" + viewSpec.preserveAspectRatioString + ")"); 122 if (viewSpec.zoomAndPan && viewSpec.zoomAndPan != SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY) 123 attributes.push("zoomAndPan(" + zoomAndPanToString(viewSpec.zoomAndPan) + ")"); 124 if (viewSpec.viewTargetString) 125 attributes.push("viewTarget(" + viewSpec.viewTargetString + ")"); 126 if (!attributes.length) 127 return "[initial view]"; 115 128 return "svgView(" + attributes.join(";") + ")"; 116 129 } 117 130 118 131 var testNumber = 0; 119 132 var testString = "[initial view]" 120 133 121 134 function makeURLRelative(url) { 122 135 return url.slice(url.indexOf("resources")); … … 132 145 embedElement.setAttribute("width", "100"); 133 146 embedElement.setAttribute("height", "100"); 134 embedElement.setAttribute("onload", " continueFuzzing(event)");135 var newURL = "resources/viewspec- parser.svg#" + string;147 embedElement.setAttribute("onload", "setTimeout('continueFuzzing(event)', 0)"); 148 var newURL = "resources/viewspec-target.svg#" + string; 136 149 embedElement.src = newURL; 137 debug("Starting: " + makeURLRelative(embedElement.src));138 150 document.body.appendChild(embedElement); 139 151 } … … 143 155 testFragment(testString); 144 156 } 145 157 146 158 function continueFuzzing(event) 147 159 { 148 160 var embedElement = document.getElementById("object"); 149 161 if (embedElement.contentDocument) { 150 debug("Loaded: 151 debug("Parsed: " + viewSpecToString(embedElement.contentDocument. currentView) + " from: " + testString);162 debug("Loaded: " + makeURLRelative(embedElement.contentDocument.URL)); 163 debug("Parsed: " + viewSpecToString(embedElement.contentDocument.documentElement.currentView) + " from: " + testString + "\n"); 152 164 } else 153 165 debug("no svgdocument"); 154 166 155 167 if (testNumber < testsToRun.length) 156 168 testString = testsToRun[testNumber]; 157 169 else { 158 var scriptTag = document.createElement("script"); 159 scriptTag.src = "../../fast/js/resources/js-test-post.js"; 160 document.body.appendChild(scriptTag); 161 if (window.layoutTestController) 162 layoutTestController.notifyDone(); 170 var script = document.createElement("script"); 171 172 script.onload = function() { 173 if (window.layoutTestController) 174 layoutTestController.notifyDone(); 175 }; 176 177 script.src = "../../fast/js/resources/js-test-post.js"; 178 document.body.appendChild(script); 163 179 return; 164 180 } 165 181 testNumber++; 166 182 167 183 // this lets us out of the onload handler so we don't overrun the stack 168 184 window.setTimeout(startNextTest, 0); … … 170 186 if (window.layoutTestController) 171 187 layoutTestController.waitUntilDone(); 172 188 173 189 buildTestsToRun(); 174 190 testFragment(""); -
trunk/Source/WebCore/CMakeLists.txt
r118567 r118735 1977 1977 svg/SVGUseElement.cpp 1978 1978 svg/SVGViewElement.cpp 1979 svg/SVGViewSpec.cpp 1979 1980 svg/SVGVKernElement.cpp 1980 svg/SVGViewSpec.cpp1981 1981 svg/SVGZoomAndPan.cpp 1982 1982 svg/SVGZoomEvent.cpp … … 2136 2136 svg/SVGUseElement.idl 2137 2137 svg/SVGViewElement.idl 2138 svg/SVGViewSpec.idl 2138 2139 svg/SVGVKernElement.idl 2139 2140 svg/SVGZoomAndPan.idl -
trunk/Source/WebCore/ChangeLog
r118733 r118735 1 2012-05-29 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 SVGViewSpec DOM bindings aka SVGSVGElement.currentView is unimplemented 4 https://bugs.webkit.org/show_bug.cgi?id=15495 5 6 Reviewed by Rob Buis. 7 8 Finish SVGViewSpec implementation and expose it to the Web. Numerous smaller bugs are fixed: 9 - SVGViewSpec and all of its contents should be read-only. Enforce that and test it. 10 Add a new enum to SVGPropertyInfo so that each SVGAnimatedProperty knows if its content is supposed to be read-write or read-only. 11 - Make the 'transform' attribute of SVGViewSpec exposable by switching to a SVGTransformListProperty - it can now be accessed from JS. 12 - Assure that following XXXString methods are in sync with the corresponding SVG DOM interfaces 13 readonly attribute DOMString viewBoxString; 14 readonly attribute DOMString preserveAspectRatioString; 15 readonly attribute DOMString transformString; 16 readonly attribute DOMString viewTargetString; 17 - Cleanup code in svg/properties that was intended to handle SVGViewSpec. Turns out lot of the complexity was unncessary, and can be removed. 18 - Move SVGFitToViewBox to the same pattern SVGZoomAndPan uses since two days, that avoids any virtual function calls for attribute parsing. 19 - Create/expose ObjectiveC/JS bindings for SVGViewSpec. 20 - Enable SVGViewSpec constructor. 21 22 Tests: svg/custom/linking-a-03-b-all-expected.svg 23 svg/dom/SVGViewSpec-defaults.html 24 svg/dom/SVGViewSpec.html 25 svg/dom/complex-svgView-specification.html 26 svg/dom/viewspec-parser.html 27 28 * CMakeLists.txt: 29 * DerivedSources.cpp: 30 * DerivedSources.make: 31 * DerivedSources.pri: 32 * GNUmakefile.list.am: 33 * Target.pri: 34 * WebCore.gyp/WebCore.gyp: 35 * WebCore.gypi: 36 * WebCore.order: 37 * WebCore.vcproj/WebCore.vcproj: 38 * WebCore.xcodeproj/project.pbxproj: 39 * bindings/js/JSSVGLengthCustom.cpp: 40 (WebCore::JSSVGLength::setValue): 41 (WebCore::JSSVGLength::convertToSpecifiedUnits): 42 * bindings/objc/DOMSVG.h: 43 * bindings/scripts/CodeGeneratorJS.pm: 44 (GenerateImplementation): 45 (NativeToJSValue): 46 * bindings/scripts/CodeGeneratorObjC.pm: 47 (GenerateImplementation): 48 * bindings/scripts/CodeGeneratorV8.pm: 49 (GenerateNormalAttrGetter): 50 (GenerateNormalAttrSetter): 51 (GenerateFunctionCallback): 52 * bindings/v8/custom/V8SVGLengthCustom.cpp: 53 (WebCore::V8SVGLength::valueAccessorSetter): 54 (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback): 55 * page/DOMWindow.idl: 56 * rendering/svg/RenderSVGResourcePattern.cpp: 57 (WebCore::RenderSVGResourcePattern::buildTileImageTransform): 58 * svg/SVGFitToViewBox.cpp: 59 * svg/SVGFitToViewBox.h: 60 (SVGFitToViewBox): 61 (WebCore::SVGFitToViewBox::parseAttribute): 62 * svg/SVGMarkerElement.cpp: 63 (WebCore::SVGMarkerElement::orientTypePropertyInfo): 64 (WebCore::SVGMarkerElement::parseAttribute): 65 (WebCore::SVGMarkerElement::synchronizeOrientType): 66 (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper): 67 * svg/SVGPathElement.cpp: 68 (WebCore::SVGPathElement::dPropertyInfo): 69 (WebCore::SVGPathElement::svgAttributeChanged): 70 (WebCore::SVGPathElement::pathByteStream): 71 (WebCore::SVGPathElement::lookupOrCreateDWrapper): 72 (WebCore::SVGPathElement::synchronizeD): 73 * svg/SVGPathSegWithContext.h: 74 (WebCore::SVGPathSegWithContext::animatedProperty): 75 * svg/SVGPatternElement.cpp: 76 (WebCore::SVGPatternElement::parseAttribute): 77 * svg/SVGPolyElement.cpp: 78 (WebCore::SVGPolyElement::pointsPropertyInfo): 79 (WebCore::SVGPolyElement::parseAttribute): 80 (WebCore::SVGPolyElement::synchronizePoints): 81 (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper): 82 * svg/SVGRect.h: 83 * svg/SVGSVGElement.cpp: 84 (WebCore::SVGSVGElement::~SVGSVGElement): 85 (WebCore::SVGSVGElement::currentView): 86 (WebCore::SVGSVGElement::parseAttribute): 87 (WebCore::SVGSVGElement::currentViewBoxRect): 88 (WebCore::SVGSVGElement::viewBoxToViewTransform): 89 (WebCore::SVGSVGElement::setupInitialView): 90 (WebCore::SVGSVGElement::inheritViewAttributes): 91 * svg/SVGSVGElement.h: 92 (SVGSVGElement): 93 * svg/SVGSVGElement.idl: 94 * svg/SVGSymbolElement.cpp: 95 (WebCore::SVGSymbolElement::parseAttribute): 96 * svg/SVGTests.cpp: 97 (WebCore::SVGTests::requiredFeaturesPropertyInfo): 98 (WebCore::SVGTests::requiredExtensionsPropertyInfo): 99 (WebCore::SVGTests::systemLanguagePropertyInfo): 100 (WebCore::SVGTests::synchronizeRequiredFeatures): 101 (WebCore::SVGTests::synchronizeRequiredExtensions): 102 (WebCore::SVGTests::synchronizeSystemLanguage): 103 * svg/SVGTextContentElement.cpp: 104 (WebCore::SVGTextContentElement::textLengthPropertyInfo): 105 (WebCore::SVGTextContentElement::synchronizeTextLength): 106 (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper): 107 * svg/SVGViewElement.cpp: 108 (WebCore::SVGViewElement::parseAttribute): 109 * svg/SVGViewElement.h: 110 * svg/SVGViewSpec.cpp: 111 (WebCore::SVGViewSpec::viewBoxPropertyInfo): 112 (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo): 113 (WebCore::SVGViewSpec::transformPropertyInfo): 114 (WebCore::SVGViewSpec::SVGViewSpec): 115 (WebCore::SVGViewSpec::viewBoxIdentifier): 116 (WebCore::SVGViewSpec::preserveAspectRatioIdentifier): 117 (WebCore::SVGViewSpec::transformIdentifier): 118 (WebCore::SVGViewSpec::setZoomAndPan): 119 (WebCore::SVGViewSpec::setTransformString): 120 (WebCore::SVGViewSpec::transformString): 121 (WebCore::SVGViewSpec::viewBoxString): 122 (WebCore::SVGViewSpec::preserveAspectRatioString): 123 (WebCore::SVGViewSpec::viewTarget): 124 (WebCore::SVGViewSpec::transform): 125 (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): 126 (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper): 127 (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): 128 (WebCore::SVGViewSpec::reset): 129 (WebCore::SVGViewSpec::parseViewSpec): 130 * svg/SVGViewSpec.h: 131 (WebCore::SVGViewSpec::~SVGViewSpec): 132 (SVGViewSpec): 133 (WebCore::SVGViewSpec::create): 134 (WebCore::SVGViewSpec::setViewTargetString): 135 (WebCore::SVGViewSpec::setZoomAndPan): 136 (WebCore::SVGViewSpec::contextElement): 137 (WebCore::SVGViewSpec::resetContextElement): 138 (WebCore::SVGViewSpec::transformBaseValue): 139 (WebCore::SVGViewSpec::viewBoxAnimated): 140 (WebCore::SVGViewSpec::viewBox): 141 (WebCore::SVGViewSpec::viewBoxBaseValue): 142 (WebCore::SVGViewSpec::setViewBoxBaseValue): 143 (WebCore::SVGViewSpec::preserveAspectRatioAnimated): 144 (WebCore::SVGViewSpec::preserveAspectRatio): 145 (WebCore::SVGViewSpec::preserveAspectRatioBaseValue): 146 (WebCore::SVGViewSpec::setPreserveAspectRatioBaseValue): 147 * svg/SVGViewSpec.idl: 148 * svg/properties/SVGAnimatedProperty.h: 149 (WebCore::SVGAnimatedProperty::isReadOnly): 150 (WebCore::SVGAnimatedProperty::setIsReadOnly): 151 (SVGAnimatedProperty): 152 (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper): 153 (WebCore::SVGAnimatedProperty::lookupWrapper): 154 (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): 155 * svg/properties/SVGAnimatedPropertyMacros.h: 156 (WebCore::SVGSynchronizableAnimatedProperty::synchronize): 157 (SVGSynchronizableAnimatedProperty): 158 * svg/properties/SVGAnimatedPropertySynchronizer.h: Removed. 159 * svg/properties/SVGAttributeToPropertyMap.h: 160 * svg/properties/SVGListProperty.h: 161 * svg/properties/SVGListPropertyTearOff.h: 162 (SVGListPropertyTearOff): 163 (WebCore::SVGListPropertyTearOff::isReadOnly): 164 * svg/properties/SVGPathSegListPropertyTearOff.h: 165 (SVGPathSegListPropertyTearOff): 166 (WebCore::SVGPathSegListPropertyTearOff::isReadOnly): 167 * svg/properties/SVGProperty.h: 168 (SVGProperty): 169 * svg/properties/SVGPropertyInfo.h: 170 (WebCore::SVGPropertyInfo::SVGPropertyInfo): 171 (SVGPropertyInfo): 172 * svg/properties/SVGPropertyTearOff.h: 173 (WebCore::SVGPropertyTearOff::isReadOnly): 174 * svg/properties/SVGStaticListPropertyTearOff.h: 175 (SVGStaticListPropertyTearOff): 176 (WebCore::SVGStaticListPropertyTearOff::isReadOnly): 177 1 178 2012-05-29 Kent Tamura <tkent@chromium.org> 2 179 -
trunk/Source/WebCore/DerivedSources.cpp
r118353 r118735 438 438 #include "JSSVGUnitTypes.cpp" 439 439 #include "JSSVGUseElement.cpp" 440 #include "JSSVGVKernElement.cpp" 440 441 #include "JSSVGViewElement.cpp" 441 #include "JSSVGV KernElement.cpp"442 #include "JSSVGViewSpec.cpp" 442 443 #include "JSSVGZoomAndPan.cpp" 443 444 #include "JSSVGZoomEvent.cpp" -
trunk/Source/WebCore/DerivedSources.make
r118226 r118735 576 576 $(WebCore)/svg/SVGVKernElement.idl \ 577 577 $(WebCore)/svg/SVGViewElement.idl \ 578 $(WebCore)/svg/SVGViewSpec.idl \ 578 579 $(WebCore)/svg/SVGZoomAndPan.idl \ 579 580 $(WebCore)/svg/SVGZoomEvent.idl \ -
trunk/Source/WebCore/DerivedSources.pri
r118353 r118735 607 607 $$PWD/svg/SVGViewElement.idl \ 608 608 $$PWD/svg/SVGVKernElement.idl \ 609 $$PWD/svg/SVGViewSpec.idl \ 609 610 $$PWD/svg/SVGZoomAndPan.idl \ 610 611 $$PWD/svg/SVGZoomEvent.idl -
trunk/Source/WebCore/GNUmakefile.list.am
r118567 r118735 4203 4203 Source/WebCore/svg/properties/SVGAnimatedPropertyDescription.h \ 4204 4204 Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h \ 4205 Source/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h \4206 4205 Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h \ 4207 4206 Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h \ … … 5393 5392 DerivedSources/WebCore/JSSVGViewElement.cpp \ 5394 5393 DerivedSources/WebCore/JSSVGViewElement.h \ 5394 DerivedSources/WebCore/JSSVGViewSpec.cpp \ 5395 5395 DerivedSources/WebCore/JSSVGViewSpec.h \ 5396 5396 DerivedSources/WebCore/JSSVGVKernElement.cpp \ … … 5542 5542 $(WebCore)/svg/SVGVKernElement.idl \ 5543 5543 $(WebCore)/svg/SVGViewElement.idl \ 5544 $(WebCore)/svg/SVGViewSpec.idl \ 5544 5545 $(WebCore)/svg/SVGZoomAndPan.idl \ 5545 5546 $(WebCore)/svg/SVGZoomEvent.idl -
trunk/Source/WebCore/Target.pri
r118567 r118735 2635 2635 svg/properties/SVGAnimatedPropertyDescription.h \ 2636 2636 svg/properties/SVGAnimatedPropertyMacros.h \ 2637 svg/properties/SVGAnimatedPropertySynchronizer.h \2638 2637 svg/properties/SVGAnimatedPropertyTearOff.h \ 2639 2638 svg/properties/SVGAnimatedStaticPropertyTearOff.h \ -
trunk/Source/WebCore/WebCore.gyp/WebCore.gyp
r118672 r118735 174 174 '../svg/SVGTests.idl', 175 175 '../svg/SVGTransformable.idl', 176 '../svg/SVGViewSpec.idl',177 176 178 177 # FIXME: I don't know why these are excluded, either. -
trunk/Source/WebCore/WebCore.gypi
r118668 r118735 740 740 'svg/properties/SVGAnimatedPropertyDescription.h', 741 741 'svg/properties/SVGAnimatedPropertyMacros.h', 742 'svg/properties/SVGAnimatedPropertySynchronizer.h',743 742 'svg/properties/SVGAnimatedPropertyTearOff.h', 744 743 'svg/properties/SVGAnimatedStaticPropertyTearOff.h', … … 7169 7168 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGVKernElement.mm', 7170 7169 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGVKernElementInternal.h', 7170 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewSpec.dep', 7171 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewSpec.mm', 7171 7172 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewElement.dep', 7172 7173 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewElement.mm', … … 8133 8134 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGViewElement.dep', 8134 8135 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGViewElement.h', 8136 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGViewSpec.cpp', 8137 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGViewSpec.dep', 8138 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGViewSpec.h', 8135 8139 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGZoomAndPan.cpp', 8136 8140 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGZoomAndPan.h', -
trunk/Source/WebCore/WebCore.order
r117971 r118735 29346 29346 __ZN7WebCore8SVGTests27synchronizeRequiredFeaturesEPNS_10SVGElementE 29347 29347 __ZNK7WebCore13SVGStringList13valueAsStringEv 29348 __ZN7WebCore31SVGAnimatedPropertySynchronizerILb1EE11synchronizeEPNS_10SVGElementERKNS_13QualifiedNameERKN3WTF12AtomicStringE29349 29348 __ZN7WebCore8SVGTests29synchronizeRequiredExtensionsEPNS_10SVGElementE 29350 29349 __ZN7WebCore8SVGTests25synchronizeSystemLanguageEPNS_10SVGElementE -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r118567 r118735 21835 21835 </File> 21836 21836 <File 21837 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSVGViewSpec.cpp" 21838 > 21839 <FileConfiguration 21840 Name="Debug|Win32" 21841 ExcludedFromBuild="true" 21842 > 21843 <Tool 21844 Name="VCCLCompilerTool" 21845 /> 21846 </FileConfiguration> 21847 <FileConfiguration 21848 Name="Release|Win32" 21849 ExcludedFromBuild="true" 21850 > 21851 <Tool 21852 Name="VCCLCompilerTool" 21853 /> 21854 </FileConfiguration> 21855 <FileConfiguration 21856 Name="Debug_Cairo_CFLite|Win32" 21857 ExcludedFromBuild="true" 21858 > 21859 <Tool 21860 Name="VCCLCompilerTool" 21861 /> 21862 </FileConfiguration> 21863 <FileConfiguration 21864 Name="Release_Cairo_CFLite|Win32" 21865 ExcludedFromBuild="true" 21866 > 21867 <Tool 21868 Name="VCCLCompilerTool" 21869 /> 21870 </FileConfiguration> 21871 <FileConfiguration 21872 Name="Debug_All|Win32" 21873 ExcludedFromBuild="true" 21874 > 21875 <Tool 21876 Name="VCCLCompilerTool" 21877 /> 21878 </FileConfiguration> 21879 <FileConfiguration 21880 Name="Production|Win32" 21881 ExcludedFromBuild="true" 21882 > 21883 <Tool 21884 Name="VCCLCompilerTool" 21885 /> 21886 </FileConfiguration> 21887 </File> 21888 <File 21889 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSVGViewSpec.h" 21890 > 21891 </File> 21892 <File 21837 21893 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSVGVKernElement.cpp" 21838 21894 > … … 72183 72239 </File> 72184 72240 <File 72185 RelativePath="..\svg\properties\SVGAnimatedPropertySynchronizer.h"72186 >72187 </File>72188 <File72189 72241 RelativePath="..\svg\properties\SVGAnimatedPropertyTearOff.h" 72190 72242 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r118624 r118735 138 138 081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */; }; 139 139 081AA8DA1111237E002AB06E /* SVGElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 081AA8D91111237E002AB06E /* SVGElementRareData.h */; }; 140 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */; settings = {ATTRIBUTES = (Private, ); }; };141 140 081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 142 141 081EBF3A0FD34F4100DA7559 /* SVGFilterBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */; }; … … 1805 1804 6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */; }; 1806 1805 7117445914BC34EC00EE5FC8 /* SVGTextMetricsBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 7117445714BC34E200EE5FC8 /* SVGTextMetricsBuilder.h */; }; 1806 7118FED415685CC60030B79A /* JSSVGViewSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7118FED215685CC60030B79A /* JSSVGViewSpec.cpp */; }; 1807 7118FED515685CC60030B79A /* JSSVGViewSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118FED315685CC60030B79A /* JSSVGViewSpec.h */; }; 1807 1808 7134496D146941B300720312 /* SVGLengthContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7134496B146941B300720312 /* SVGLengthContext.cpp */; }; 1808 1809 7134496E146941B300720312 /* SVGLengthContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 7134496C146941B300720312 /* SVGLengthContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1809 1810 71537A01146BD9D7008BD615 /* SVGPathData.h in Headers */ = {isa = PBXBuildFile; fileRef = 715379FF146BD9D6008BD615 /* SVGPathData.h */; }; 1810 1811 7157F062150B6564006EAABD /* SVGAnimatedTransformList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */; }; 1812 717A1981156A63BE00F9FE8C /* DOMSVGViewSpecInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 710867D51568644B00AA779B /* DOMSVGViewSpecInternal.h */; }; 1813 71904DE8156A631C001E1BA5 /* DOMSVGViewSpec.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 71FE57EE156A620600ABEBD3 /* DOMSVGViewSpec.h */; }; 1814 71904DEA156A633A001E1BA5 /* DOMSVGViewSpecInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 718512331568649800C40967 /* DOMSVGViewSpecInternal.h */; }; 1811 1815 71A57DF1154BE25C0009D120 /* SVGPathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */; }; 1812 1816 71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; }; … … 1816 1820 71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */; }; 1817 1821 71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1822 71FE57F0156A620600ABEBD3 /* DOMSVGViewSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FE57EE156A620600ABEBD3 /* DOMSVGViewSpec.h */; }; 1823 71FE57F1156A620600ABEBD3 /* DOMSVGViewSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 71FE57EF156A620600ABEBD3 /* DOMSVGViewSpec.mm */; }; 1818 1824 72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; }; 1819 1825 750D029311D0E7F300BD1B27 /* RenderInputSpeech.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */; }; … … 6876 6882 A8F46A910CB20A9D003A9670 /* DOMSVGViewElement.h in Copy Generated Headers */, 6877 6883 A80F3B5F0CCDCE24002DD990 /* DOMSVGViewElementInternal.h in Copy Generated Headers */, 6884 71904DE8156A631C001E1BA5 /* DOMSVGViewSpec.h in Copy Generated Headers */, 6878 6885 A8F46AFD0CB20A9D003A9670 /* DOMSVGZoomAndPan.h in Copy Generated Headers */, 6886 71904DEA156A633A001E1BA5 /* DOMSVGViewSpecInternal.h in Copy Generated Headers */, 6879 6887 A8F46A930CB20A9D003A9670 /* DOMSVGZoomEvent.h in Copy Generated Headers */, 6880 6888 A80F3BB10CCDCE24002DD990 /* DOMSVGZoomEventInternal.h in Copy Generated Headers */, … … 7016 7024 081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutEngine.h; sourceTree = "<group>"; }; 7017 7025 081AA8D91111237E002AB06E /* SVGElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGElementRareData.h; sourceTree = "<group>"; }; 7018 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertySynchronizer.h; sourceTree = "<group>"; };7019 7026 081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyInfo.h; sourceTree = "<group>"; }; 7020 7027 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilterBuilder.cpp; sourceTree = "<group>"; }; … … 8853 8860 6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextAttributes.cpp; sourceTree = "<group>"; }; 8854 8861 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextAttributes.h; sourceTree = "<group>"; }; 8862 710867D51568644B00AA779B /* DOMSVGViewSpecInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGViewSpecInternal.h; sourceTree = "<group>"; }; 8855 8863 7117445614BC34E200EE5FC8 /* SVGTextMetricsBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextMetricsBuilder.cpp; sourceTree = "<group>"; }; 8856 8864 7117445714BC34E200EE5FC8 /* SVGTextMetricsBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextMetricsBuilder.h; sourceTree = "<group>"; }; 8865 7118FED215685CC60030B79A /* JSSVGViewSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGViewSpec.cpp; sourceTree = "<group>"; }; 8866 7118FED315685CC60030B79A /* JSSVGViewSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGViewSpec.h; sourceTree = "<group>"; }; 8857 8867 7134496B146941B300720312 /* SVGLengthContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthContext.cpp; sourceTree = "<group>"; }; 8858 8868 7134496C146941B300720312 /* SVGLengthContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthContext.h; sourceTree = "<group>"; }; … … 8860 8870 715379FF146BD9D6008BD615 /* SVGPathData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathData.h; sourceTree = "<group>"; }; 8861 8871 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTransformList.cpp; sourceTree = "<group>"; }; 8872 718512331568649800C40967 /* DOMSVGViewSpecInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMSVGViewSpecInternal.h; sourceTree = "<group>"; }; 8862 8873 71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; }; 8863 8874 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; }; … … 8868 8879 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedIntegerOptionalInteger.h; sourceTree = "<group>"; }; 8869 8880 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumerationPropertyTearOff.h; sourceTree = "<group>"; }; 8881 71FE57EE156A620600ABEBD3 /* DOMSVGViewSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGViewSpec.h; sourceTree = "<group>"; }; 8882 71FE57EF156A620600ABEBD3 /* DOMSVGViewSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMSVGViewSpec.mm; sourceTree = "<group>"; }; 8870 8883 72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; }; 8871 8884 750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderInputSpeech.cpp; sourceTree = "<group>"; }; … … 13789 13802 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */, 13790 13803 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */, 13791 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */,13792 13804 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */, 13793 13805 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */, … … 16196 16208 859D62980AD888EF00012995 /* DOMSVGViewElement.mm */, 16197 16209 A8E543C90CA9D1C10097D09B /* DOMSVGViewElementInternal.h */, 16210 71FE57EE156A620600ABEBD3 /* DOMSVGViewSpec.h */, 16211 71FE57EF156A620600ABEBD3 /* DOMSVGViewSpec.mm */, 16212 718512331568649800C40967 /* DOMSVGViewSpecInternal.h */, 16198 16213 84852281119016A7006EDC7F /* DOMSVGVKernElement.h */, 16199 16214 84852282119016A7006EDC7F /* DOMSVGVKernElement.mm */, … … 16653 16668 859D62D90AD8892700012995 /* DOMSVGUseElementInternal.h */, 16654 16669 859D62DA0AD8892700012995 /* DOMSVGViewElementInternal.h */, 16670 710867D51568644B00AA779B /* DOMSVGViewSpecInternal.h */, 16655 16671 859D62DB0AD8892700012995 /* DOMSVGZoomEventInternal.h */, 16656 16672 4429AB070CB84F81007647C5 /* DOMTextEventInternal.h */, … … 18382 18398 B2FA3D2E0AB75A6F000E5AC4 /* JSSVGViewElement.cpp */, 18383 18399 B2FA3D2F0AB75A6F000E5AC4 /* JSSVGViewElement.h */, 18400 7118FED215685CC60030B79A /* JSSVGViewSpec.cpp */, 18401 7118FED315685CC60030B79A /* JSSVGViewSpec.h */, 18384 18402 848522791190162C006EDC7F /* JSSVGVKernElement.cpp */, 18385 18403 8485227A1190162C006EDC7F /* JSSVGVKernElement.h */, … … 24466 24484 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */, 24467 24485 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */, 24468 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */,24469 24486 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */, 24470 24487 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */, … … 24958 24975 71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */, 24959 24976 0F3F0E5A157030C3006DA57F /* RenderGeometryMap.h in Headers */, 24977 7118FED515685CC60030B79A /* JSSVGViewSpec.h in Headers */, 24978 71FE57F0156A620600ABEBD3 /* DOMSVGViewSpec.h in Headers */, 24979 717A1981156A63BE00F9FE8C /* DOMSVGViewSpecInternal.h in Headers */, 24960 24980 ); 24961 24981 runOnlyForDeploymentPostprocessing = 0; … … 27990 28010 71DCB7011568197600862271 /* JSSVGZoomAndPan.cpp in Sources */, 27991 28011 0F3F0E59157030C3006DA57F /* RenderGeometryMap.cpp in Sources */, 28012 7118FED415685CC60030B79A /* JSSVGViewSpec.cpp in Sources */, 28013 71FE57F1156A620600ABEBD3 /* DOMSVGViewSpec.mm in Sources */, 27992 28014 ); 27993 28015 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp
r115670 r118735 49 49 void JSSVGLength::setValue(ExecState* exec, JSValue value) 50 50 { 51 if (impl()-> role() == AnimValRole) {51 if (impl()->isReadOnly()) { 52 52 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR); 53 53 return; … … 74 74 JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec) 75 75 { 76 if (impl()-> role() == AnimValRole) {76 if (impl()->isReadOnly()) { 77 77 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR); 78 78 return jsUndefined(); -
trunk/Source/WebCore/bindings/objc/DOMSVG.h
r91331 r118735 170 170 #import <WebCore/DOMSVGUseElement.h> 171 171 #import <WebCore/DOMSVGViewElement.h> 172 #import <WebCore/DOMSVGViewSpec.h> 172 173 #import <WebCore/DOMSVGZoomAndPan.h> 173 174 #import <WebCore/DOMSVGZoomEvent.h> -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r118616 r118735 1957 1957 if ($svgPropertyOrListPropertyType) { 1958 1958 if ($svgPropertyType) { 1959 push(@implContent, " if (impl-> role() == AnimValRole) {\n");1959 push(@implContent, " if (impl->isReadOnly()) {\n"); 1960 1960 push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n"); 1961 1961 push(@implContent, " return;\n"); … … 2130 2130 push(@implContent, " $implType* impl = static_cast<$implType*>(castedThis->impl());\n"); 2131 2131 if ($svgPropertyType) { 2132 push(@implContent, " if (impl-> role() == AnimValRole) {\n");2132 push(@implContent, " if (impl->isReadOnly()) {\n"); 2133 2133 push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n"); 2134 2134 push(@implContent, " return JSValue::encode(jsUndefined());\n"); … … 3100 3100 } 3101 3101 3102 if ($codeGenerator->IsSVGAnimatedType($implClassName) ) {3102 if ($codeGenerator->IsSVGAnimatedType($implClassName) or $implClassName eq "SVGViewSpec") { 3103 3103 # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked. 3104 3104 $value = "static_cast<" . GetNativeType($type) . ">($value)"; -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r114887 r118735 1329 1329 } 1330 1330 } 1331 } elsif ( $codeGenerator->IsSVGAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) {1331 } elsif (($codeGenerator->IsSVGAnimatedType($implClassName) or $implClassName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) { 1332 1332 my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType); 1333 1333 $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)"; … … 1437 1437 $implIncludes{"ExceptionCode.h"} = 1; 1438 1438 $getterContentHead = "$getterExpressionPrefix"; 1439 push(@implContent, " if (IMPL-> role() == WebCore::AnimValRole) {\n");1439 push(@implContent, " if (IMPL->isReadOnly()) {\n"); 1440 1440 push(@implContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n"); 1441 1441 push(@implContent, " return;\n"); … … 1637 1637 } elsif ($svgPropertyType) { 1638 1638 $implIncludes{"ExceptionCode.h"} = 1; 1639 push(@functionContent, " if (IMPL-> role() == WebCore::AnimValRole) {\n");1639 push(@functionContent, " if (IMPL->isReadOnly()) {\n"); 1640 1640 push(@functionContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n"); 1641 1641 if ($returnType eq "void") { -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r118726 r118735 946 946 } 947 947 948 if ( $codeGenerator->IsSVGAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) {948 if (($codeGenerator->IsSVGAnimatedType($implClassName) or $implClassName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) { 949 949 AddToImplIncludes("V8$attrType.h"); 950 950 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); … … 1062 1062 AddToImplIncludes("ExceptionCode.h"); 1063 1063 push(@implContentDecls, " $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());\n"); 1064 push(@implContentDecls, " if (wrapper-> role() == AnimValRole) {\n");1064 push(@implContentDecls, " if (wrapper->isReadOnly()) {\n"); 1065 1065 push(@implContentDecls, " V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());\n"); 1066 1066 push(@implContentDecls, " return;\n"); … … 1396 1396 AddToImplIncludes("ExceptionCode.h"); 1397 1397 push(@implContentDecls, " $nativeClassName wrapper = V8${implClassName}::toNative(args.Holder());\n"); 1398 push(@implContentDecls, " if (wrapper-> role() == AnimValRole)\n");1398 push(@implContentDecls, " if (wrapper->isReadOnly())\n"); 1399 1399 push(@implContentDecls, " return V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());\n"); 1400 1400 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); -
trunk/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
r118063 r118735 59 59 INC_STATS("DOM.SVGLength.value._set"); 60 60 SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder()); 61 if (wrapper-> role() == AnimValRole) {61 if (wrapper->isReadOnly()) { 62 62 V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate()); 63 63 return; … … 83 83 INC_STATS("DOM.SVGLength.convertToSpecifiedUnits"); 84 84 SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder()); 85 if (wrapper-> role() == AnimValRole)85 if (wrapper->isReadOnly()) 86 86 return V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate()); 87 87 -
trunk/Source/WebCore/page/DOMWindow.idl
r118484 r118735 709 709 attribute SVGUseElementConstructor SVGUseElement; 710 710 attribute SVGViewElementConstructor SVGViewElement; 711 //attribute SVGViewSpecConstructor SVGViewSpec;711 attribute SVGViewSpecConstructor SVGViewSpec; 712 712 attribute SVGZoomAndPanConstructor SVGZoomAndPan; 713 713 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
r112555 r118735 28 28 #include "PatternAttributes.h" 29 29 #include "RenderSVGRoot.h" 30 #include "SVGFitToViewBox.h" 30 31 #include "SVGRenderSupport.h" 31 32 #include "SVGRenderingContext.h" … … 216 217 return false; 217 218 218 AffineTransform viewBoxCTM = patternElement->viewBoxToViewTransform(attributes.viewBox(), attributes.preserveAspectRatio(), patternBoundaries.width(), patternBoundaries.height());219 AffineTransform viewBoxCTM = SVGFitToViewBox::viewBoxToViewTransform(attributes.viewBox(), attributes.preserveAspectRatio(), patternBoundaries.width(), patternBoundaries.height()); 219 220 220 221 // Apply viewBox/objectBoundingBox transformations. -
trunk/Source/WebCore/svg/SVGFitToViewBox.cpp
r117195 r118735 89 89 } 90 90 91 bool SVGFitToViewBox::parseAttribute(Document* document, const Attribute& attribute)92 {93 if (attribute.name() == SVGNames::viewBoxAttr) {94 FloatRect viewBox;95 if (!attribute.isNull())96 parseViewBox(document, attribute.value(), viewBox);97 setViewBoxBaseValue(viewBox);98 return true;99 }100 101 if (attribute.name() == SVGNames::preserveAspectRatioAttr) {102 SVGPreserveAspectRatio preserveAspectRatio;103 preserveAspectRatio.parse(attribute.value());104 setPreserveAspectRatioBaseValue(preserveAspectRatio);105 return true;106 }107 108 return false;109 }110 111 91 bool SVGFitToViewBox::isKnownAttribute(const QualifiedName& attrName) 112 92 { -
trunk/Source/WebCore/svg/SVGFitToViewBox.h
r117195 r118735 23 23 24 24 #if ENABLE(SVG) 25 #include "Attribute.h" 26 #include "FloatRect.h" 25 27 #include "QualifiedName.h" 28 #include "SVGNames.h" 29 #include "SVGPreserveAspectRatio.h" 26 30 #include <wtf/HashSet.h> 27 31 … … 29 33 30 34 class AffineTransform; 31 class Attribute;32 35 class Document; 33 class FloatRect;34 class SVGPreserveAspectRatio;35 36 36 37 class SVGFitToViewBox { 37 38 public: 38 virtual ~SVGFitToViewBox() { }39 40 bool parseViewBox(Document*, const UChar*& start, const UChar* end, FloatRect& viewBox, bool validate = true);41 39 static AffineTransform viewBoxToViewTransform(const FloatRect& viewBoxRect, const SVGPreserveAspectRatio&, float viewWidth, float viewHeight); 42 40 43 bool parseAttribute(Document*, const Attribute&); 44 bool isKnownAttribute(const QualifiedName&); 45 void addSupportedAttributes(HashSet<QualifiedName>&); 41 static bool isKnownAttribute(const QualifiedName&); 42 static void addSupportedAttributes(HashSet<QualifiedName>&); 46 43 47 virtual void setViewBoxBaseValue(const FloatRect&) = 0; 48 virtual void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio&) = 0; 44 template<class SVGElementTarget> 45 static bool parseAttribute(SVGElementTarget* target, const Attribute& attribute) 46 { 47 ASSERT(target); 48 ASSERT(target->document()); 49 if (attribute.name() == SVGNames::viewBoxAttr) { 50 FloatRect viewBox; 51 if (!attribute.isNull()) 52 parseViewBox(target->document(), attribute.value(), viewBox); 53 target->setViewBoxBaseValue(viewBox); 54 return true; 55 } 56 57 if (attribute.name() == SVGNames::preserveAspectRatioAttr) { 58 SVGPreserveAspectRatio preserveAspectRatio; 59 preserveAspectRatio.parse(attribute.value()); 60 target->setPreserveAspectRatioBaseValue(preserveAspectRatio); 61 return true; 62 } 63 64 return false; 65 } 66 67 static bool parseViewBox(Document*, const UChar*& start, const UChar* end, FloatRect& viewBox, bool validate = true); 49 68 50 69 private: 51 bool parseViewBox(Document*, const String&, FloatRect&);70 static bool parseViewBox(Document*, const String&, FloatRect&); 52 71 }; 53 72 -
trunk/Source/WebCore/svg/SVGMarkerElement.cpp
r117195 r118735 40 40 if (!s_propertyInfo) { 41 41 s_propertyInfo = new SVGPropertyInfo(AnimatedEnumeration, 42 PropertyIsReadWrite, 42 43 SVGNames::orientAttr, 43 44 orientTypeIdentifier(), … … 154 155 } else if (SVGLangSpace::parseAttribute(attribute) 155 156 || SVGExternalResourcesRequired::parseAttribute(attribute) 156 || SVGFitToViewBox::parseAttribute( document(), attribute)) {157 || SVGFitToViewBox::parseAttribute(this, attribute)) { 157 158 } else 158 159 ASSERT_NOT_REACHED(); … … 240 241 241 242 DEFINE_STATIC_LOCAL(AtomicString, autoString, ("auto")); 242 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, orientTypePropertyInfo()->attributeName, autoString);243 ownerType->m_orientType.synchronize(ownerType, orientTypePropertyInfo()->attributeName, autoString); 243 244 } 244 245 … … 247 248 ASSERT(contextElement); 248 249 SVGMarkerElement* ownerType = static_cast<SVGMarkerElement*>(contextElement); 249 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGMarkerElement, SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType , true>250 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGMarkerElement, SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType> 250 251 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); 251 252 } -
trunk/Source/WebCore/svg/SVGPathElement.cpp
r117696 r118735 53 53 if (!s_propertyInfo) { 54 54 s_propertyInfo = new SVGPropertyInfo(AnimatedPath, 55 PropertyIsReadWrite, 55 56 SVGNames::dAttr, 56 57 SVGNames::dAttr.localName(), … … 262 263 263 264 if (attrName == SVGNames::dAttr) { 264 if (m_pathSegList.shouldSynchronize && !SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff , true>(this, dPropertyInfo())->isAnimating()) {265 if (m_pathSegList.shouldSynchronize && !SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(this, dPropertyInfo())->isAnimating()) { 265 266 SVGPathSegList newList(PathSegUnalteredRole); 266 267 buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, newList, UnalteredParsing); … … 278 279 SVGPathByteStream* SVGPathElement::pathByteStream() const 279 280 { 280 SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff , true>(this, dPropertyInfo());281 SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(this, dPropertyInfo()); 281 282 if (!property || !property->isAnimating()) 282 283 return m_pathByteStream.get(); … … 289 290 SVGPathElement* ownerType = static_cast<SVGPathElement*>(contextElement); 290 291 291 if (SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff , true>(ownerType, dPropertyInfo()))292 if (SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(ownerType, dPropertyInfo())) 292 293 return property; 293 294 … … 295 296 buildSVGPathSegListFromByteStream(ownerType->m_pathByteStream.get(), ownerType, ownerType->m_pathSegList.value, UnalteredParsing); 296 297 297 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList , true>298 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList> 298 299 (ownerType, dPropertyInfo(), ownerType->m_pathSegList.value); 299 300 } … … 305 306 if (!ownerType->m_pathSegList.shouldSynchronize) 306 307 return; 307 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, dPropertyInfo()->attributeName, ownerType->m_pathSegList.value.valueAsString());308 ownerType->m_pathSegList.synchronize(ownerType, dPropertyInfo()->attributeName, ownerType->m_pathSegList.value.valueAsString()); 308 309 } 309 310 -
trunk/Source/WebCore/svg/SVGPathSegWithContext.h
r113184 r118735 40 40 return 0; 41 41 case PathSegUnalteredRole: 42 return SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff , true>(m_element.get(), SVGPathElement::dPropertyInfo());42 return SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(m_element.get(), SVGPathElement::dPropertyInfo()); 43 43 case PathSegNormalizedRole: 44 44 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! -
trunk/Source/WebCore/svg/SVGPatternElement.cpp
r117195 r118735 35 35 #include "RenderSVGResourcePattern.h" 36 36 #include "SVGElementInstance.h" 37 #include "SVGFitToViewBox.h" 37 38 #include "SVGNames.h" 38 39 #include "SVGRenderSupport.h" … … 144 145 || SVGLangSpace::parseAttribute(attribute) 145 146 || SVGExternalResourcesRequired::parseAttribute(attribute) 146 || SVGFitToViewBox::parseAttribute( document(), attribute)) {147 || SVGFitToViewBox::parseAttribute(this, attribute)) { 147 148 } else 148 149 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/svg/SVGPolyElement.cpp
r117195 r118735 42 42 if (!s_propertyInfo) { 43 43 s_propertyInfo = new SVGPropertyInfo(AnimatedPoints, 44 PropertyIsReadWrite, 44 45 SVGNames::pointsAttr, 45 46 SVGNames::pointsAttr.localName(), … … 91 92 document()->accessSVGExtensions()->reportError("Problem parsing points=\"" + value + "\""); 92 93 93 if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGPolyElement, SVGAnimatedPointList , true>(this, pointsPropertyInfo()))94 if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGPolyElement, SVGAnimatedPointList>(this, pointsPropertyInfo())) 94 95 static_cast<SVGAnimatedPointList*>(wrapper)->detachListWrappers(newList.size()); 95 96 … … 144 145 if (!ownerType->m_points.shouldSynchronize) 145 146 return; 146 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, pointsPropertyInfo()->attributeName, ownerType->m_points.value.valueAsString());147 ownerType->m_points.synchronize(ownerType, pointsPropertyInfo()->attributeName, ownerType->m_points.value.valueAsString()); 147 148 } 148 149 … … 151 152 ASSERT(contextElement); 152 153 SVGPolyElement* ownerType = static_cast<SVGPolyElement*>(contextElement); 153 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPolyElement, SVGAnimatedPointList, SVGPointList , true>154 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPolyElement, SVGAnimatedPointList, SVGPointList> 154 155 (ownerType, pointsPropertyInfo(), ownerType->m_points.value); 155 156 } -
trunk/Source/WebCore/svg/SVGRect.h
r95901 r118735 41 41 builder.append(' '); 42 42 builder.append(String::number(type.height())); 43 builder.append(' ');44 43 return builder.toString(); 45 44 } -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r118353 r118735 47 47 #include "SVGAngle.h" 48 48 #include "SVGElementInstance.h" 49 #include "SVGFitToViewBox.h" 49 50 #include "SVGNames.h" 50 51 #include "SVGPreserveAspectRatio.h" … … 53 54 #include "SVGViewElement.h" 54 55 #include "SVGViewSpec.h" 55 #include "SVGZoomAndPan.h"56 56 #include "SVGZoomEvent.h" 57 57 #include "ScriptEventListener.h" … … 104 104 SVGSVGElement::~SVGSVGElement() 105 105 { 106 if (m_viewSpec) 107 m_viewSpec->resetContextElement(); 106 108 document()->unregisterForPageCacheSuspensionCallbacks(this); 107 109 // There are cases where removedFromDocument() is not called. … … 171 173 } 172 174 173 SVGViewSpec* SVGSVGElement::currentView() const175 SVGViewSpec* SVGSVGElement::currentView() 174 176 { 175 177 if (!m_viewSpec) 176 m_viewSpec = adoptPtr(new SVGViewSpec(const_cast<SVGSVGElement*>(this)));178 m_viewSpec = SVGViewSpec::create(this); 177 179 return m_viewSpec.get(); 178 180 } … … 270 272 || SVGLangSpace::parseAttribute(attribute) 271 273 || SVGExternalResourcesRequired::parseAttribute(attribute) 272 || SVGFitToViewBox::parseAttribute( document(), attribute)274 || SVGFitToViewBox::parseAttribute(this, attribute) 273 275 || SVGZoomAndPan::parseAttribute(this, attribute)) { 274 276 } else … … 526 528 FloatRect SVGSVGElement::currentViewBoxRect() const 527 529 { 528 if (useCurrentView()) { 529 if (SVGViewSpec* view = currentView()) // what if we should use it but it is not set? 530 return view->viewBox(); 531 return FloatRect(); 532 } 530 if (m_useCurrentView) 531 return m_viewSpec ? m_viewSpec->viewBox() : FloatRect(); 533 532 534 533 FloatRect useViewBox = viewBox(); … … 647 646 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const 648 647 { 649 AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight); 650 if (useCurrentView() && currentView()) { 651 AffineTransform transform; 652 if (currentView()->transformBaseValue().concatenate(transform)) 653 ctm *= transform; 654 } 648 if (!m_useCurrentView || !m_viewSpec) 649 return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight); 650 651 AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_viewSpec->preserveAspectRatio(), viewWidth, viewHeight); 652 const SVGTransformList& transformList = m_viewSpec->transformBaseValue(); 653 if (transformList.isEmpty()) 654 return ctm; 655 656 AffineTransform transform; 657 if (transformList.concatenate(transform)) 658 ctm *= transform; 655 659 656 660 return ctm; … … 659 663 void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode) 660 664 { 665 RenderObject* renderer = this->renderer(); 666 SVGViewSpec* view = m_viewSpec.get(); 667 if (view) 668 view->reset(); 669 661 670 bool hadUseCurrentView = m_useCurrentView; 671 m_useCurrentView = false; 672 662 673 if (fragmentIdentifier.startsWith("xpointer(")) { 663 674 // FIXME: XPointer references are ignored (https://bugs.webkit.org/show_bug.cgi?id=17491) 664 setUseCurrentView(false); 665 } else if (fragmentIdentifier.startsWith("svgView(")) { 666 if (currentView()->parseViewSpec(fragmentIdentifier)) 667 setUseCurrentView(true); 668 } else if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) { 675 if (renderer && hadUseCurrentView) 676 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 677 return; 678 } 679 680 if (fragmentIdentifier.startsWith("svgView(")) { 681 if (!view) 682 view = currentView(); // Create the SVGViewSpec. 683 684 if (view->parseViewSpec(fragmentIdentifier)) 685 m_useCurrentView = true; 686 else 687 view->reset(); 688 689 if (renderer && (hadUseCurrentView || m_useCurrentView)) 690 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 691 return; 692 } 693 694 // Spec: If the SVG fragment identifier addresses a ‘view’ element within an SVG document (e.g., MyDrawing.svg#MyView 695 // or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor ‘svg’ element is displayed in the viewport. 696 // Any view specification attributes included on the given ‘view’ element override the corresponding view specification 697 // attributes on the closest ancestor ‘svg’ element. 698 if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) { 669 699 if (SVGViewElement* viewElement = anchorNode->hasTagName(SVGNames::viewTag) ? static_cast<SVGViewElement*>(anchorNode) : 0) { 670 700 SVGElement* element = SVGLocatable::nearestViewportElement(viewElement); … … 672 702 SVGSVGElement* svg = static_cast<SVGSVGElement*>(element); 673 703 svg->inheritViewAttributes(viewElement); 674 setUseCurrentView(true); 704 705 if (RenderObject* renderer = svg->renderer()) 706 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 675 707 } 676 708 } 677 } 678 679 if (!hadUseCurrentView) { 680 if (!m_useCurrentView) 681 return; 682 } else if (!m_useCurrentView) 683 currentView()->setTransformString(emptyString()); 684 685 // Force a layout, otherwise RenderSVGRoots localToBorderBoxTransform won't be rebuild. 686 if (RenderObject* object = renderer()) 687 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object); 709 return; 710 } 688 711 689 712 // FIXME: We need to decide which <svg> to focus on, and zoom to it. … … 693 716 void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) 694 717 { 718 SVGViewSpec* view = currentView(); 719 m_useCurrentView = true; 720 695 721 if (viewElement->hasAttribute(SVGNames::viewBoxAttr)) 696 currentView()->setViewBoxBaseValue(viewElement->viewBox());722 view->setViewBoxBaseValue(viewElement->viewBox()); 697 723 else 698 currentView()->setViewBoxBaseValue(viewBox()); 699 700 SVGPreserveAspectRatio aspectRatio; 724 view->setViewBoxBaseValue(viewBox()); 725 701 726 if (viewElement->hasAttribute(SVGNames::preserveAspectRatioAttr)) 702 aspectRatio = viewElement->preserveAspectRatioBaseValue();727 view->setPreserveAspectRatioBaseValue(viewElement->preserveAspectRatioBaseValue()); 703 728 else 704 aspectRatio = preserveAspectRatioBaseValue(); 705 currentView()->setPreserveAspectRatioBaseValue(aspectRatio); 729 view->setPreserveAspectRatioBaseValue(preserveAspectRatioBaseValue()); 706 730 707 731 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr)) 708 currentView()->setZoomAndPanBaseValue(viewElement->zoomAndPan()); 709 710 if (RenderObject* object = renderer()) 711 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object); 712 } 713 732 view->setZoomAndPanBaseValue(viewElement->zoomAndPan()); 733 else 734 view->setZoomAndPanBaseValue(zoomAndPan()); 735 } 736 714 737 void SVGSVGElement::documentWillSuspendForPageCache() 715 738 { -
trunk/Source/WebCore/svg/SVGSVGElement.h
r118353 r118735 73 73 74 74 bool useCurrentView() const { return m_useCurrentView; } 75 void setUseCurrentView(bool currentView) { m_useCurrentView = currentView; } 76 77 SVGViewSpec* currentView() const; 75 SVGViewSpec* currentView(); 78 76 79 77 enum ConsiderCSSMode { … … 192 190 RefPtr<SMILTimeContainer> m_timeContainer; 193 191 FloatPoint m_translation; 194 mutable OwnPtr<SVGViewSpec> m_viewSpec;192 RefPtr<SVGViewSpec> m_viewSpec; 195 193 }; 196 194 -
trunk/Source/WebCore/svg/SVGSVGElement.idl
r107304 r118735 49 49 readonly attribute float screenPixelToMillimeterX; 50 50 readonly attribute float screenPixelToMillimeterY; 51 attribute boolean useCurrentView 52 /*setter raises(DOMException)*/; 53 // TODO readonly attribute SVGViewSpec currentView; 51 readonly attribute boolean useCurrentView; 52 readonly attribute SVGViewSpec currentView; 54 53 attribute float currentScale 55 54 /*setter raises(DOMException)*/; -
trunk/Source/WebCore/svg/SVGSymbolElement.cpp
r117195 r118735 77 77 if (SVGExternalResourcesRequired::parseAttribute(attribute)) 78 78 return; 79 if (SVGFitToViewBox::parseAttribute( document(), attribute))79 if (SVGFitToViewBox::parseAttribute(this, attribute)) 80 80 return; 81 81 -
trunk/Source/WebCore/svg/SVGTests.cpp
r117195 r118735 39 39 if (!s_propertyInfo) { 40 40 s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown, 41 PropertyIsReadWrite, 41 42 SVGNames::requiredFeaturesAttr, 42 43 SVGNames::requiredFeaturesAttr.localName(), … … 53 54 if (!s_propertyInfo) { 54 55 s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown, 56 PropertyIsReadWrite, 55 57 SVGNames::requiredExtensionsAttr, 56 58 SVGNames::requiredExtensionsAttr.localName(), … … 67 69 if (!s_propertyInfo) { 68 70 s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown, 71 PropertyIsReadWrite, 69 72 SVGNames::systemLanguageAttr, 70 73 SVGNames::systemLanguageAttr.localName(), … … 174 177 return; 175 178 AtomicString value(m_requiredFeatures.value.valueAsString()); 176 SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, requiredFeaturesPropertyInfo()->attributeName, value);179 m_requiredFeatures.synchronize(contextElement, requiredFeaturesPropertyInfo()->attributeName, value); 177 180 } 178 181 … … 183 186 return; 184 187 AtomicString value(m_requiredExtensions.value.valueAsString()); 185 SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, requiredExtensionsPropertyInfo()->attributeName, value);188 m_requiredExtensions.synchronize(contextElement, requiredExtensionsPropertyInfo()->attributeName, value); 186 189 } 187 190 … … 192 195 return; 193 196 AtomicString value(m_systemLanguage.value.valueAsString()); 194 SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, systemLanguagePropertyInfo()->attributeName, value);197 m_systemLanguage.synchronize(contextElement, systemLanguagePropertyInfo()->attributeName, value); 195 198 } 196 199 -
trunk/Source/WebCore/svg/SVGTextContentElement.cpp
r117225 r118735 45 45 if (!s_propertyInfo) { 46 46 s_propertyInfo = new SVGPropertyInfo(AnimatedLength, 47 PropertyIsReadWrite, 47 48 SVGNames::textLengthAttr, 48 49 SVGNames::textLengthAttr.localName(), … … 81 82 return; 82 83 AtomicString value(SVGPropertyTraits<SVGLength>::toString(ownerType->m_specifiedTextLength)); 83 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, textLengthPropertyInfo()->attributeName, value);84 ownerType->m_textLength.synchronize(ownerType, textLengthPropertyInfo()->attributeName, value); 84 85 } 85 86 … … 88 89 ASSERT(contextElement); 89 90 SVGTextContentElement* ownerType = static_cast<SVGTextContentElement*>(contextElement); 90 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGTextContentElement, SVGAnimatedLength, SVGLength , true>91 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGTextContentElement, SVGAnimatedLength, SVGLength> 91 92 (ownerType, textLengthPropertyInfo(), ownerType->m_textLength.value); 92 93 } -
trunk/Source/WebCore/svg/SVGViewElement.cpp
r118353 r118735 84 84 if (SVGExternalResourcesRequired::parseAttribute(attribute)) 85 85 return; 86 if (SVGFitToViewBox::parseAttribute( document(), attribute))86 if (SVGFitToViewBox::parseAttribute(this, attribute)) 87 87 return; 88 88 if (SVGZoomAndPan::parseAttribute(this, attribute)) -
trunk/Source/WebCore/svg/SVGViewElement.h
r118353 r118735 45 45 46 46 SVGStringList& viewTarget() { return m_viewTarget; } 47 48 47 SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } 49 48 void setZoomAndPan(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); } -
trunk/Source/WebCore/svg/SVGViewSpec.cpp
r118353 r118735 24 24 25 25 #include "Document.h" 26 #include "SVGAnimatedTransformList.h" 27 #include "SVGFitToViewBox.h" 26 28 #include "SVGNames.h" 27 29 #include "SVGParserUtilities.h" … … 31 33 namespace WebCore { 32 34 33 // Animated property definitions 34 DEFINE_ANIMATED_RECT(SVGViewSpec, SVGNames::viewBoxAttr, ViewBox, viewBox) 35 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGViewSpec, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio) 36 37 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGViewSpec) 38 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) 39 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) 40 END_REGISTER_ANIMATED_PROPERTIES 35 // Define custom animated property 'viewBox'. 36 const SVGPropertyInfo* SVGViewSpec::viewBoxPropertyInfo() 37 { 38 static const SVGPropertyInfo* s_propertyInfo = 0; 39 if (!s_propertyInfo) { 40 s_propertyInfo = new SVGPropertyInfo(AnimatedRect, 41 PropertyIsReadOnly, 42 SVGNames::viewBoxAttr, 43 viewBoxIdentifier(), 44 0, 45 &SVGViewSpec::lookupOrCreateViewBoxWrapper); 46 } 47 return s_propertyInfo; 48 } 49 50 // Define custom animated property 'preserveAspectRatio'. 51 const SVGPropertyInfo* SVGViewSpec::preserveAspectRatioPropertyInfo() 52 { 53 static const SVGPropertyInfo* s_propertyInfo = 0; 54 if (!s_propertyInfo) { 55 s_propertyInfo = new SVGPropertyInfo(AnimatedPreserveAspectRatio, 56 PropertyIsReadOnly, 57 SVGNames::preserveAspectRatioAttr, 58 preserveAspectRatioIdentifier(), 59 0, 60 &SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper); 61 } 62 return s_propertyInfo; 63 } 64 65 66 // Define custom non-animated property 'transform'. 67 const SVGPropertyInfo* SVGViewSpec::transformPropertyInfo() 68 { 69 static const SVGPropertyInfo* s_propertyInfo = 0; 70 if (!s_propertyInfo) { 71 s_propertyInfo = new SVGPropertyInfo(AnimatedTransformList, 72 PropertyIsReadOnly, 73 SVGNames::transformAttr, 74 transformIdentifier(), 75 0, 76 &SVGViewSpec::lookupOrCreateTransformWrapper); 77 } 78 return s_propertyInfo; 79 } 41 80 42 81 SVGViewSpec::SVGViewSpec(SVGElement* contextElement) … … 45 84 { 46 85 ASSERT(m_contextElement); 47 registerAnimatedPropertiesForSVGViewSpec(); 86 } 87 88 const AtomicString& SVGViewSpec::viewBoxIdentifier() 89 { 90 DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGViewSpecViewBoxAttribute")); 91 return s_identifier; 92 } 93 94 const AtomicString& SVGViewSpec::preserveAspectRatioIdentifier() 95 { 96 DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGViewSpecPreserveAspectRatioAttribute")); 97 return s_identifier; 98 } 99 100 const AtomicString& SVGViewSpec::transformIdentifier() 101 { 102 DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGViewSpecTransformAttribute")); 103 return s_identifier; 104 } 105 106 void SVGViewSpec::setZoomAndPan(unsigned short, ExceptionCode& ec) 107 { 108 // SVGViewSpec and all of its content is read-only. 109 ec = NO_MODIFICATION_ALLOWED_ERR; 48 110 } 49 111 50 112 void SVGViewSpec::setTransformString(const String& transform) 51 113 { 52 m_transform.parse(transform); 53 } 54 55 void SVGViewSpec::setViewBoxString(const String& viewBoxStr) 56 { 57 FloatRect viewBox; 58 const UChar* c = viewBoxStr.characters(); 59 const UChar* end = c + viewBoxStr.length(); 60 if (!parseViewBox(m_contextElement->document(), c, end, viewBox, false)) 61 return; 62 setViewBoxBaseValue(viewBox); 114 if (!m_contextElement) 115 return; 116 117 SVGTransformList newList; 118 newList.parse(transform); 119 120 if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGElement, SVGAnimatedTransformList>(m_contextElement, transformPropertyInfo())) 121 static_cast<SVGAnimatedTransformList*>(wrapper)->detachListWrappers(newList.size()); 122 123 m_transform = newList; 124 } 125 126 String SVGViewSpec::transformString() const 127 { 128 return SVGPropertyTraits<SVGTransformList>::toString(m_transform); 129 } 130 131 String SVGViewSpec::viewBoxString() const 132 { 133 return SVGPropertyTraits<FloatRect>::toString(viewBoxBaseValue()); 63 134 } 64 135 … … 70 141 } 71 142 72 void SVGViewSpec::setViewTargetString(const String& viewTargetString) 73 { 74 m_viewTargetString = viewTargetString;143 String SVGViewSpec::preserveAspectRatioString() const 144 { 145 return SVGPropertyTraits<SVGPreserveAspectRatio>::toString(preserveAspectRatioBaseValue()); 75 146 } 76 147 77 148 SVGElement* SVGViewSpec::viewTarget() const 78 149 { 150 if (!m_contextElement) 151 return 0; 79 152 return static_cast<SVGElement*>(m_contextElement->treeScope()->getElementById(m_viewTargetString)); 153 } 154 155 SVGTransformListPropertyTearOff* SVGViewSpec::transform() 156 { 157 // Return the animVal here, as its readonly by default - which is exactly what we want here. 158 return static_cast<SVGTransformListPropertyTearOff*>(static_pointer_cast<SVGAnimatedTransformList>(lookupOrCreateTransformWrapper(this))->animVal()); 159 } 160 161 PassRefPtr<SVGAnimatedProperty> SVGViewSpec::lookupOrCreateViewBoxWrapper(void* maskedOwnerType) 162 { 163 ASSERT(maskedOwnerType); 164 SVGViewSpec* ownerType = static_cast<SVGViewSpec*>(maskedOwnerType); 165 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedRect, FloatRect>(ownerType->contextElement(), viewBoxPropertyInfo(), ownerType->m_viewBox); 166 } 167 168 PassRefPtr<SVGAnimatedProperty> SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper(void* maskedOwnerType) 169 { 170 ASSERT(maskedOwnerType); 171 SVGViewSpec* ownerType = static_cast<SVGViewSpec*>(maskedOwnerType); 172 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio>(ownerType->contextElement(), preserveAspectRatioPropertyInfo(), ownerType->m_preserveAspectRatio); 173 } 174 175 PassRefPtr<SVGAnimatedProperty> SVGViewSpec::lookupOrCreateTransformWrapper(void* maskedOwnerType) 176 { 177 ASSERT(maskedOwnerType); 178 SVGViewSpec* ownerType = static_cast<SVGViewSpec*>(maskedOwnerType); 179 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedTransformList, SVGTransformList>(ownerType->contextElement(), transformPropertyInfo(), ownerType->m_transform); 180 } 181 182 void SVGViewSpec::reset() 183 { 184 m_zoomAndPan = SVGZoomAndPanMagnify; 185 m_transform.clear(); 186 m_viewBox = FloatRect(); 187 m_preserveAspectRatio = SVGPreserveAspectRatio(); 188 m_viewTargetString = emptyString(); 80 189 } 81 190 … … 92 201 const UChar* end = currViewSpec + viewSpec.length(); 93 202 94 if (currViewSpec >= end )203 if (currViewSpec >= end || !m_contextElement) 95 204 return false; 96 205 … … 109 218 currViewSpec++; 110 219 FloatRect viewBox; 111 if (! parseViewBox(m_contextElement->document(), currViewSpec, end, viewBox, false))220 if (!SVGFitToViewBox::parseViewBox(m_contextElement->document(), currViewSpec, end, viewBox, false)) 112 221 return false; 113 222 setViewBoxBaseValue(viewBox); -
trunk/Source/WebCore/svg/SVGViewSpec.h
r118353 r118735 31 31 32 32 class SVGElement; 33 class SVGTransformListPropertyTearOff; 33 34 34 class SVGViewSpec : public SVGZoomAndPan,35 public SVGFitToViewBox {36 WTF_MAKE_NONCOPYABLE(SVGViewSpec);35 class SVGViewSpec : public RefCounted<SVGViewSpec> 36 , public SVGZoomAndPan 37 , public SVGFitToViewBox { 37 38 public: 38 SVGViewSpec(SVGElement*); 39 virtual ~SVGViewSpec() { } 40 41 using RefCounted<SVGViewSpec>::ref; 42 using RefCounted<SVGViewSpec>::deref; 43 44 static PassRefPtr<SVGViewSpec> create(SVGElement* contextElement) 45 { 46 return adoptRef(new SVGViewSpec(contextElement)); 47 } 39 48 40 49 bool parseViewSpec(const String&); 50 void reset(); 51 52 SVGElement* viewTarget() const; 53 String viewBoxString() const; 54 55 void setPreserveAspectRatioString(const String&); 56 String preserveAspectRatioString() const; 41 57 42 58 void setTransformString(const String&); 43 SVGTransformList transform() const { return m_transform; } 44 SVGTransformList transformBaseValue() const { return m_transform; } 59 String transformString() const; 45 60 46 void setViewBoxString(const String&); 47 48 void setPreserveAspectRatioString(const String&); 49 50 void setViewTargetString(const String&); 61 void setViewTargetString(const String& string) { m_viewTargetString = string; } 51 62 String viewTargetString() const { return m_viewTargetString; } 52 SVGElement* viewTarget() const;53 63 54 64 SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } 65 void setZoomAndPan(unsigned short zoomAndPan) { setZoomAndPanBaseValue(zoomAndPan); } 55 66 void setZoomAndPan(unsigned short, ExceptionCode&); 56 67 void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); } 57 68 69 SVGElement* contextElement() const { return m_contextElement; } 70 void resetContextElement() { m_contextElement = 0; } 71 72 // Custom non-animated 'transform' property. 73 SVGTransformListPropertyTearOff* transform(); 74 SVGTransformList transformBaseValue() const { return m_transform; } 75 76 // Custom animated 'viewBox' property. 77 PassRefPtr<SVGAnimatedRect> viewBoxAnimated() 78 { 79 return static_pointer_cast<SVGAnimatedRect>(lookupOrCreateViewBoxWrapper(this)); 80 } 81 82 FloatRect& viewBox() { return m_viewBox; } 83 FloatRect viewBoxBaseValue() const { return m_viewBox; } 84 void setViewBoxBaseValue(const FloatRect& viewBox) { m_viewBox = viewBox; } 85 86 // Custom animated 'preserveAspectRatio' property. 87 PassRefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() 88 { 89 return static_pointer_cast<SVGAnimatedPreserveAspectRatio>(lookupOrCreatePreserveAspectRatioWrapper(this)); 90 } 91 92 SVGPreserveAspectRatio& preserveAspectRatio() { return m_preserveAspectRatio; } 93 SVGPreserveAspectRatio preserveAspectRatioBaseValue() const { return m_preserveAspectRatio; } 94 void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio& preserveAspectRatio) { m_preserveAspectRatio = preserveAspectRatio; } 95 58 96 private: 97 SVGViewSpec(SVGElement*); 98 99 static const SVGPropertyInfo* transformPropertyInfo(); 100 static const SVGPropertyInfo* viewBoxPropertyInfo(); 101 static const SVGPropertyInfo* preserveAspectRatioPropertyInfo(); 102 103 static const AtomicString& transformIdentifier(); 104 static const AtomicString& viewBoxIdentifier(); 105 static const AtomicString& preserveAspectRatioIdentifier(); 106 107 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTransformWrapper(void* contextElement); 108 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateViewBoxWrapper(void* contextElement); 109 static PassRefPtr<SVGAnimatedProperty> lookupOrCreatePreserveAspectRatioWrapper(void* contextElement); 110 59 111 SVGElement* m_contextElement; 60 61 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGViewSpec) 62 DECLARE_ANIMATED_RECT(ViewBox, viewBox) 63 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio) 64 END_DECLARE_ANIMATED_PROPERTIES 112 SVGZoomAndPanType m_zoomAndPan; 65 113 66 114 SVGTransformList m_transform; 115 FloatRect m_viewBox; 116 SVGPreserveAspectRatio m_preserveAspectRatio; 67 117 String m_viewTargetString; 68 SVGZoomAndPanType m_zoomAndPan;69 118 }; 70 119 -
trunk/Source/WebCore/svg/SVGViewSpec.idl
r89269 r118735 26 26 module svg { 27 27 28 // SVGViewSpec intentionally doesn't inherit from SVGZoomAndPan & SVGFitToViewBox on the IDLs. 29 // It would require that any of those classes would be RefCounted, and we want to avoid that. 28 30 interface [ 29 Conditional=SVG 30 ] SVGViewSpec : SVGZoomAndPan, SVGFitToViewBox31 {31 Conditional=SVG, 32 JSGenerateToJSObject 33 ] SVGViewSpec { 32 34 readonly attribute SVGTransformList transform; 33 readonly attribute SVGElement viewTarget; 34 readonly attribute DOMString viewBoxString; 35 readonly attribute DOMString preserveAspectRatioString; 36 readonly attribute DOMString transformString; 37 readonly attribute DOMString viewTargetString; 35 readonly attribute SVGElement viewTarget; 36 readonly attribute DOMString viewBoxString; 37 readonly attribute DOMString preserveAspectRatioString; 38 readonly attribute DOMString transformString; 39 readonly attribute DOMString viewTargetString; 40 41 // SVGZoomAndPan 42 attribute unsigned short zoomAndPan 43 setter raises(DOMException); 44 45 // SVGFitToViewBox 46 readonly attribute SVGAnimatedRect viewBox; 47 readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio; 38 48 }; 39 49 -
trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h
r116451 r118735 37 37 AnimatedPropertyType animatedPropertyType() const { return m_animatedPropertyType; } 38 38 bool isAnimating() const { return m_isAnimating; } 39 bool isReadOnly() const { return m_isReadOnly; } 40 void setIsReadOnly() { m_isReadOnly = true; } 39 41 40 42 void commitChange() … … 67 69 } 68 70 69 // lookupOrCreateWrapper & helper methods. 70 template<typename TearOffType, typename PropertyType, bool isDerivedFromSVGElement> 71 struct LookupOrCreateHelper; 72 73 template<typename TearOffType, typename PropertyType> 74 struct LookupOrCreateHelper<TearOffType, PropertyType, false> { 75 static PassRefPtr<TearOffType> lookupOrCreateWrapper(void*, const SVGPropertyInfo*, PropertyType&) 76 { 77 ASSERT_NOT_REACHED(); 78 return PassRefPtr<TearOffType>(); 79 } 80 }; 81 82 template<typename TearOffType, typename PropertyType> 83 struct LookupOrCreateHelper<TearOffType, PropertyType, true> { 84 static PassRefPtr<TearOffType> lookupOrCreateWrapper(SVGElement* element, const SVGPropertyInfo* info, PropertyType& property) 85 { 86 ASSERT(info); 87 SVGAnimatedPropertyDescription key(element, info->propertyIdentifier); 88 RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key); 89 if (!wrapper) { 90 wrapper = TearOffType::create(element, info->attributeName, info->animatedPropertyType, property); 91 animatedPropertyCache()->set(key, wrapper.get()); 92 } 93 return static_pointer_cast<TearOffType>(wrapper); 94 } 95 }; 96 97 template<typename OwnerType, typename TearOffType, typename PropertyType, bool isDerivedFromSVGElement> 71 template<typename OwnerType, typename TearOffType, typename PropertyType> 98 72 static PassRefPtr<TearOffType> lookupOrCreateWrapper(OwnerType* element, const SVGPropertyInfo* info, PropertyType& property) 99 73 { 100 return LookupOrCreateHelper<TearOffType, PropertyType, isDerivedFromSVGElement>::lookupOrCreateWrapper(element, info, property); 74 ASSERT(info); 75 SVGAnimatedPropertyDescription key(element, info->propertyIdentifier); 76 RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key); 77 if (!wrapper) { 78 wrapper = TearOffType::create(element, info->attributeName, info->animatedPropertyType, property); 79 if (info->animatedPropertyState == PropertyIsReadOnly) 80 wrapper->setIsReadOnly(); 81 animatedPropertyCache()->set(key, wrapper.get()); 82 } 83 return static_pointer_cast<TearOffType>(wrapper); 101 84 } 102 85 103 // lookupWrapper & helper methods. 104 template<typename TearOffType, bool isDerivedFromSVGElement> 105 struct LookupHelper; 86 template<typename OwnerType, typename TearOffType> 87 static TearOffType* lookupWrapper(OwnerType* element, const SVGPropertyInfo* info) 88 { 89 ASSERT(info); 90 SVGAnimatedPropertyDescription key(element, info->propertyIdentifier); 91 return static_cast<TearOffType*>(animatedPropertyCache()->get(key)); 92 } 106 93 107 template<typename TearOffType> 108 struct LookupHelper<TearOffType, false> { 109 static TearOffType* lookupWrapper(const void*, const SVGPropertyInfo*) 110 { 111 return 0; 112 } 113 }; 114 115 template<typename TearOffType> 116 struct LookupHelper<TearOffType, true> { 117 static TearOffType* lookupWrapper(const SVGElement* element, const SVGPropertyInfo* info) 118 { 119 ASSERT(info); 120 SVGAnimatedPropertyDescription key(const_cast<SVGElement*>(element), info->propertyIdentifier); 121 return static_cast<TearOffType*>(animatedPropertyCache()->get(key)); 122 } 123 }; 124 125 template<typename OwnerType, typename TearOffType, bool isDerivedFromSVGElement> 94 template<typename OwnerType, typename TearOffType> 126 95 static TearOffType* lookupWrapper(const OwnerType* element, const SVGPropertyInfo* info) 127 96 { 128 return LookupHelper<TearOffType, isDerivedFromSVGElement>::lookupWrapper(element, info);97 return lookupWrapper<OwnerType, TearOffType>(const_cast<OwnerType*>(element), info); 129 98 } 130 99 … … 135 104 , m_animatedPropertyType(animatedPropertyType) 136 105 , m_isAnimating(false) 106 , m_isReadOnly(false) 137 107 { 138 108 } … … 151 121 protected: 152 122 bool m_isAnimating; 123 bool m_isReadOnly; 153 124 }; 154 125 -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
r95901 r118735 24 24 25 25 #if ENABLE(SVG) 26 #include "SVGAnimatedProperty.h" 26 27 #include "SVGAttributeToPropertyMap.h" 27 28 #include "SVGPropertyTraits.h" … … 29 30 30 31 namespace WebCore { 31 32 // IsDerivedFromSVGElement implementation33 template<typename OwnerType>34 struct IsDerivedFromSVGElement {35 static const bool value = true;36 };37 38 class SVGTests;39 template<>40 struct IsDerivedFromSVGElement<SVGTests> {41 static const bool value = false;42 };43 44 class SVGViewSpec;45 template<>46 struct IsDerivedFromSVGElement<SVGViewSpec> {47 static const bool value = false;48 };49 32 50 33 // SVGSynchronizableAnimatedProperty implementation … … 69 52 , shouldSynchronize(false) 70 53 { 54 } 55 56 void synchronize(SVGElement* ownerElement, const QualifiedName& attrName, const AtomicString& value) 57 { 58 // If the attribute already exists on the element, we change the 59 // Attribute directly to avoid a call to Element::attributeChanged 60 // that could cause the SVGElement to erroneously reset its properties. 61 // svg/dom/SVGStringList-basics.xhtml exercises this behavior. 62 ElementAttributeData* attributeData = ownerElement->ensureUpdatedAttributeData(); 63 Attribute* old = attributeData->getAttributeItem(attrName); 64 if (old && value.isNull()) 65 attributeData->removeAttribute(old->name(), ownerElement); 66 else if (!old && !value.isNull()) 67 attributeData->addAttribute(Attribute(attrName, value), ownerElement); 68 else if (old && !value.isNull()) 69 old->setValue(value); 71 70 } 72 71 … … 103 102 DEFINE_STATIC_LOCAL(const SVGPropertyInfo, s_propertyInfo, \ 104 103 (AnimatedPropertyTypeEnum, \ 104 PropertyIsReadWrite, \ 105 105 DOMAttribute, \ 106 106 SVGDOMAttributeIdentifier, \ … … 125 125 PropertyType& LowerProperty() const \ 126 126 { \ 127 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType, TearOffType , IsDerivedFromSVGElement<UseOwnerType>::value>(this, LowerProperty##PropertyInfo())) { \127 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType, TearOffType>(this, LowerProperty##PropertyInfo())) { \ 128 128 if (wrapper->isAnimating()) \ 129 129 return wrapper->currentAnimatedValue(); \ … … 154 154 return; \ 155 155 AtomicString value(SVGPropertyTraits<PropertyType>::toString(m_##LowerProperty.value)); \ 156 SVGAnimatedPropertySynchronizer<IsDerivedFromSVGElement<UseOwnerType>::value>::synchronize(this, LowerProperty##PropertyInfo()->attributeName, value); \156 m_##LowerProperty.synchronize(this, LowerProperty##PropertyInfo()->attributeName, value); \ 157 157 } \ 158 158 \ … … 161 161 ASSERT(maskedOwnerType); \ 162 162 UseOwnerType* ownerType = static_cast<UseOwnerType*>(maskedOwnerType); \ 163 return SVGAnimatedProperty::lookupOrCreateWrapper<UseOwnerType, TearOffType, PropertyType , IsDerivedFromSVGElement<UseOwnerType>::value>(ownerType, LowerProperty##PropertyInfo(), ownerType->m_##LowerProperty.value); \163 return SVGAnimatedProperty::lookupOrCreateWrapper<UseOwnerType, TearOffType, PropertyType>(ownerType, LowerProperty##PropertyInfo(), ownerType->m_##LowerProperty.value); \ 164 164 } \ 165 165 \ … … 180 180 void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \ 181 181 { \ 182 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType, TearOffType , IsDerivedFromSVGElement<UseOwnerType>::value>(this, LowerProperty##PropertyInfo())) \182 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType, TearOffType>(this, LowerProperty##PropertyInfo())) \ 183 183 wrapper->detachListWrappers(newListSize); \ 184 184 } -
trunk/Source/WebCore/svg/properties/SVGAttributeToPropertyMap.h
r104369 r118735 22 22 23 23 #if ENABLE(SVG) 24 #include "QualifiedName.h" 25 #include "SVGAnimatedPropertySynchronizer.h" 24 #include "SVGPropertyInfo.h" 26 25 #include <wtf/HashMap.h> 27 26 … … 30 29 class SVGAnimatedProperty; 31 30 class SVGElement; 32 struct SVGPropertyInfo;33 31 34 32 class SVGAttributeToPropertyMap { -
trunk/Source/WebCore/svg/properties/SVGListProperty.h
r113184 r118735 416 416 } 417 417 418 virtual SVGPropertyRole role() const { return m_role; }419 420 418 PropertyType& values() 421 419 { -
trunk/Source/WebCore/svg/properties/SVGListPropertyTearOff.h
r110835 r118735 38 38 typedef typename SVGAnimatedListPropertyTearOff<PropertyType>::ListWrapperCache ListWrapperCache; 39 39 40 using Base::m_role; 40 41 using Base::m_values; 41 42 using Base::m_wrappers; … … 116 117 } 117 118 119 virtual bool isReadOnly() const 120 { 121 if (m_role == AnimValRole) 122 return true; 123 if (m_animatedProperty && m_animatedProperty->isReadOnly()) 124 return true; 125 return false; 126 } 127 118 128 virtual void commitChange() 119 129 { -
trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h
r110835 r118735 127 127 SVGPathElement* contextElement() const; 128 128 129 using Base::m_role; 130 131 virtual bool isReadOnly() const 132 { 133 if (m_role == AnimValRole) 134 return true; 135 if (m_animatedProperty && m_animatedProperty->isReadOnly()) 136 return true; 137 return false; 138 } 139 129 140 virtual void commitChange() 130 141 { -
trunk/Source/WebCore/svg/properties/SVGProperty.h
r95901 r118735 36 36 virtual ~SVGProperty() { } 37 37 38 virtual SVGPropertyRole role() const = 0;38 virtual bool isReadOnly() const = 0; 39 39 virtual void commitChange() = 0; 40 40 }; -
trunk/Source/WebCore/svg/properties/SVGPropertyInfo.h
r112224 r118735 29 29 class SVGAnimatedProperty; 30 30 31 enum AnimatedPropertyState { 32 PropertyIsReadWrite, 33 PropertyIsReadOnly 34 }; 35 31 36 enum AnimatedPropertyType { 32 37 AnimatedAngle, … … 54 59 typedef PassRefPtr<SVGAnimatedProperty> (*LookupOrCreateWrapperForAnimatedProperty)(void*); 55 60 56 SVGPropertyInfo(AnimatedPropertyType newType, const QualifiedName& newAttributeName,61 SVGPropertyInfo(AnimatedPropertyType newType, AnimatedPropertyState newState, const QualifiedName& newAttributeName, 57 62 const AtomicString& newPropertyIdentifier, SynchronizeProperty newSynchronizeProperty, 58 63 LookupOrCreateWrapperForAnimatedProperty newLookupOrCreateWrapperForAnimatedProperty) 59 64 : animatedPropertyType(newType) 65 , animatedPropertyState(newState) 60 66 , attributeName(newAttributeName) 61 67 , propertyIdentifier(newPropertyIdentifier) … … 66 72 67 73 AnimatedPropertyType animatedPropertyType; 74 AnimatedPropertyState animatedPropertyState; 68 75 const QualifiedName& attributeName; 69 76 const AtomicString& propertyIdentifier; -
trunk/Source/WebCore/svg/properties/SVGPropertyTearOff.h
r115518 r118735 97 97 } 98 98 99 virtual SVGPropertyRole role() const { return m_role; } 99 virtual bool isReadOnly() const 100 { 101 if (m_role == AnimValRole) 102 return true; 103 if (m_animatedProperty && m_animatedProperty->isReadOnly()) 104 return true; 105 return false; 106 } 100 107 101 108 protected: -
trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h
r110835 r118735 34 34 typedef SVGPropertyTearOff<ListItemType> ListItemTearOff; 35 35 36 using Base::m_role; 36 37 using Base::m_values; 37 38 … … 85 86 } 86 87 88 virtual bool isReadOnly() const 89 { 90 return m_role == AnimValRole; 91 } 92 87 93 virtual void commitChange() 88 94 { -
trunk/Source/WebKit/mac/ChangeLog
r118705 r118735 1 2012-05-29 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 SVGViewSpec DOM bindings aka SVGSVGElement.currentView is unimplemented 4 https://bugs.webkit.org/show_bug.cgi?id=15495 5 6 Reviewed by Rob Buis. 7 8 * MigrateHeaders.make: Copy DOMSVGViewSpec*.h headers. 9 1 10 2012-05-25 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> 2 11 -
trunk/Source/WebKit/mac/MigrateHeaders.make
r112424 r118735 464 464 $(PRIVATE_HEADERS_DIR)/DOMSVGViewElement.h \ 465 465 $(INTERNAL_HEADERS_DIR)/DOMSVGViewElementInternal.h \ 466 $(PRIVATE_HEADERS_DIR)/DOMSVGViewSpec.h \ 467 $(INTERNAL_HEADERS_DIR)/DOMSVGViewSpecInternal.h \ 466 468 $(PRIVATE_HEADERS_DIR)/DOMSVGZoomAndPan.h \ 467 469 $(PRIVATE_HEADERS_DIR)/DOMSVGZoomEvent.h \
Note: See TracChangeset
for help on using the changeset viewer.