Changeset 118735 in webkit


Ignore:
Timestamp:
May 29, 2012 1:41:58 AM (12 years ago)
Author:
Nikolas Zimmermann
Message:

SVGViewSpec DOM bindings aka SVGSVGElement.currentView is unimplemented
https://bugs.webkit.org/show_bug.cgi?id=15495

Reviewed by Rob Buis.

Source/WebCore:

Finish SVGViewSpec implementation and expose it to the Web. Numerous smaller bugs are fixed:

  • SVGViewSpec and all of its contents should be read-only. Enforce that and test it. Add a new enum to SVGPropertyInfo so that each SVGAnimatedProperty knows if its content is supposed to be read-write or read-only.
  • Make the 'transform' attribute of SVGViewSpec exposable by switching to a SVGTransformListProperty - it can now be accessed from JS.
  • Assure that following XXXString methods are in sync with the corresponding SVG DOM interfaces

readonly attribute DOMString viewBoxString;
readonly attribute DOMString preserveAspectRatioString;
readonly attribute DOMString transformString;
readonly attribute DOMString viewTargetString;

  • Cleanup code in svg/properties that was intended to handle SVGViewSpec. Turns out lot of the complexity was unncessary, and can be removed.
  • Move SVGFitToViewBox to the same pattern SVGZoomAndPan uses since two days, that avoids any virtual function calls for attribute parsing.
  • Create/expose ObjectiveC/JS bindings for SVGViewSpec.
  • Enable SVGViewSpec constructor.

Tests: svg/custom/linking-a-03-b-all-expected.svg

svg/dom/SVGViewSpec-defaults.html
svg/dom/SVGViewSpec.html
svg/dom/complex-svgView-specification.html
svg/dom/viewspec-parser.html

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gyp/WebCore.gyp:
  • WebCore.gypi:
  • WebCore.order:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSSVGLengthCustom.cpp:

(WebCore::JSSVGLength::setValue):
(WebCore::JSSVGLength::convertToSpecifiedUnits):

  • bindings/objc/DOMSVG.h:
  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):
(NativeToJSValue):

  • bindings/scripts/CodeGeneratorObjC.pm:

(GenerateImplementation):

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateNormalAttrGetter):
(GenerateNormalAttrSetter):
(GenerateFunctionCallback):

  • bindings/v8/custom/V8SVGLengthCustom.cpp:

(WebCore::V8SVGLength::valueAccessorSetter):
(WebCore::V8SVGLength::convertToSpecifiedUnitsCallback):

  • page/DOMWindow.idl:
  • rendering/svg/RenderSVGResourcePattern.cpp:

(WebCore::RenderSVGResourcePattern::buildTileImageTransform):

  • svg/SVGFitToViewBox.cpp:
  • svg/SVGFitToViewBox.h:

(SVGFitToViewBox):
(WebCore::SVGFitToViewBox::parseAttribute):

  • svg/SVGMarkerElement.cpp:

(WebCore::SVGMarkerElement::orientTypePropertyInfo):
(WebCore::SVGMarkerElement::parseAttribute):
(WebCore::SVGMarkerElement::synchronizeOrientType):
(WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):

  • svg/SVGPathElement.cpp:

(WebCore::SVGPathElement::dPropertyInfo):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::pathByteStream):
(WebCore::SVGPathElement::lookupOrCreateDWrapper):
(WebCore::SVGPathElement::synchronizeD):

  • svg/SVGPathSegWithContext.h:

(WebCore::SVGPathSegWithContext::animatedProperty):

  • svg/SVGPatternElement.cpp:

(WebCore::SVGPatternElement::parseAttribute):

  • svg/SVGPolyElement.cpp:

(WebCore::SVGPolyElement::pointsPropertyInfo):
(WebCore::SVGPolyElement::parseAttribute):
(WebCore::SVGPolyElement::synchronizePoints):
(WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):

  • svg/SVGRect.h:
  • svg/SVGSVGElement.cpp:

(WebCore::SVGSVGElement::~SVGSVGElement):
(WebCore::SVGSVGElement::currentView):
(WebCore::SVGSVGElement::parseAttribute):
(WebCore::SVGSVGElement::currentViewBoxRect):
(WebCore::SVGSVGElement::viewBoxToViewTransform):
(WebCore::SVGSVGElement::setupInitialView):
(WebCore::SVGSVGElement::inheritViewAttributes):

  • svg/SVGSVGElement.h:

(SVGSVGElement):

  • svg/SVGSVGElement.idl:
  • svg/SVGSymbolElement.cpp:

(WebCore::SVGSymbolElement::parseAttribute):

  • svg/SVGTests.cpp:

(WebCore::SVGTests::requiredFeaturesPropertyInfo):
(WebCore::SVGTests::requiredExtensionsPropertyInfo):
(WebCore::SVGTests::systemLanguagePropertyInfo):
(WebCore::SVGTests::synchronizeRequiredFeatures):
(WebCore::SVGTests::synchronizeRequiredExtensions):
(WebCore::SVGTests::synchronizeSystemLanguage):

  • svg/SVGTextContentElement.cpp:

(WebCore::SVGTextContentElement::textLengthPropertyInfo):
(WebCore::SVGTextContentElement::synchronizeTextLength):
(WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):

  • svg/SVGViewElement.cpp:

(WebCore::SVGViewElement::parseAttribute):

  • svg/SVGViewElement.h:
  • svg/SVGViewSpec.cpp:

(WebCore::SVGViewSpec::viewBoxPropertyInfo):
(WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo):
(WebCore::SVGViewSpec::transformPropertyInfo):
(WebCore::SVGViewSpec::SVGViewSpec):
(WebCore::SVGViewSpec::viewBoxIdentifier):
(WebCore::SVGViewSpec::preserveAspectRatioIdentifier):
(WebCore::SVGViewSpec::transformIdentifier):
(WebCore::SVGViewSpec::setZoomAndPan):
(WebCore::SVGViewSpec::setTransformString):
(WebCore::SVGViewSpec::transformString):
(WebCore::SVGViewSpec::viewBoxString):
(WebCore::SVGViewSpec::preserveAspectRatioString):
(WebCore::SVGViewSpec::viewTarget):
(WebCore::SVGViewSpec::transform):
(WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper):
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
(WebCore::SVGViewSpec::reset):
(WebCore::SVGViewSpec::parseViewSpec):

  • svg/SVGViewSpec.h:

(WebCore::SVGViewSpec::~SVGViewSpec):
(SVGViewSpec):
(WebCore::SVGViewSpec::create):
(WebCore::SVGViewSpec::setViewTargetString):
(WebCore::SVGViewSpec::setZoomAndPan):
(WebCore::SVGViewSpec::contextElement):
(WebCore::SVGViewSpec::resetContextElement):
(WebCore::SVGViewSpec::transformBaseValue):
(WebCore::SVGViewSpec::viewBoxAnimated):
(WebCore::SVGViewSpec::viewBox):
(WebCore::SVGViewSpec::viewBoxBaseValue):
(WebCore::SVGViewSpec::setViewBoxBaseValue):
(WebCore::SVGViewSpec::preserveAspectRatioAnimated):
(WebCore::SVGViewSpec::preserveAspectRatio):
(WebCore::SVGViewSpec::preserveAspectRatioBaseValue):
(WebCore::SVGViewSpec::setPreserveAspectRatioBaseValue):

  • svg/SVGViewSpec.idl:
  • svg/properties/SVGAnimatedProperty.h:

(WebCore::SVGAnimatedProperty::isReadOnly):
(WebCore::SVGAnimatedProperty::setIsReadOnly):
(SVGAnimatedProperty):
(WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
(WebCore::SVGAnimatedProperty::lookupWrapper):
(WebCore::SVGAnimatedProperty::SVGAnimatedProperty):

  • svg/properties/SVGAnimatedPropertyMacros.h:

(WebCore::SVGSynchronizableAnimatedProperty::synchronize):
(SVGSynchronizableAnimatedProperty):

  • svg/properties/SVGAnimatedPropertySynchronizer.h: Removed.
  • svg/properties/SVGAttributeToPropertyMap.h:
  • svg/properties/SVGListProperty.h:
  • svg/properties/SVGListPropertyTearOff.h:

(SVGListPropertyTearOff):
(WebCore::SVGListPropertyTearOff::isReadOnly):

  • svg/properties/SVGPathSegListPropertyTearOff.h:

(SVGPathSegListPropertyTearOff):
(WebCore::SVGPathSegListPropertyTearOff::isReadOnly):

  • svg/properties/SVGProperty.h:

(SVGProperty):

  • svg/properties/SVGPropertyInfo.h:

(WebCore::SVGPropertyInfo::SVGPropertyInfo):
(SVGPropertyInfo):

  • svg/properties/SVGPropertyTearOff.h:

(WebCore::SVGPropertyTearOff::isReadOnly):

  • svg/properties/SVGStaticListPropertyTearOff.h:

(SVGStaticListPropertyTearOff):
(WebCore::SVGStaticListPropertyTearOff::isReadOnly):

Source/WebKit/mac:

  • MigrateHeaders.make: Copy DOMSVGViewSpec*.h headers.

LayoutTests:

Re-enable a long disabled test for SVGViewSpec, and make it actually work.
Extend SVGViewSpec test coverage, and rebaseline results that changed due the SVGViewSpec constructor addition.

Make linking-a-03-b-all.svg a reftest, to avoid rebaselines on all platforms.

  • platform/chromium-linux/svg/custom/linking-a-03-b-all-expected.png: Removed.
  • platform/chromium-mac/svg/custom/linking-a-03-b-all-expected.png: Removed.
  • platform/chromium-win/fast/js/global-constructors-expected.txt:
  • platform/chromium-win/svg/custom/linking-a-03-b-all-expected.png: Removed.
  • platform/chromium-win/svg/custom/linking-a-03-b-all-expected.txt: Removed.
  • platform/gtk/fast/js/global-constructors-expected.txt:
  • platform/gtk/svg/custom/linking-a-03-b-all-expected.png: Removed.
  • platform/gtk/svg/custom/linking-a-03-b-all-expected.txt: Removed.
  • platform/mac/fast/js/global-constructors-expected.txt:
  • platform/mac/svg/custom/linking-a-03-b-all-expected.png: Removed.
  • platform/mac/svg/custom/linking-a-03-b-all-expected.txt: Removed.
  • platform/qt/fast/js/global-constructors-expected.txt:
  • platform/qt/svg/custom/linking-a-03-b-all-expected.png: Removed.
  • platform/qt/svg/custom/linking-a-03-b-all-expected.txt: Removed.
  • platform/win/fast/js/global-constructors-expected.txt:
  • svg/custom/global-constructors-expected.txt:
  • svg/custom/linking-a-03-b-all-expected.svg: Added.
  • svg/dom/SVGViewSpec-defaults-expected.txt: Added.
  • svg/dom/SVGViewSpec-defaults.html: Added.
  • svg/dom/SVGViewSpec-expected.txt: Added.
  • svg/dom/SVGViewSpec.html: Added.
  • svg/dom/complex-svgView-specification-expected.html: Added.
  • svg/dom/complex-svgView-specification.html: Added.
  • svg/dom/resources/viewspec-target.svg: Added.
  • svg/dom/script-tests/SVGViewSpec-defaults.js: Added.
  • svg/dom/script-tests/SVGViewSpec.js: Added.

(completeTest.script.onload):
(completeTest):
(testFragment):
(matrixToString):
(continueTesting):

  • svg/dom/viewspec-parser-expected.txt: Added.
  • svg/dom/viewspec-parser.html: Renamed from LayoutTests/svg/dom/viewspec-parser.html-disabled.
Location:
trunk
Files:
11 added
11 deleted
58 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r118734 r118735  
     12012-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
    1472012-05-29  Marcus Bulach  <bulach@chromium.org>
    248
  • trunk/LayoutTests/platform/chromium-win/fast/js/global-constructors-expected.txt

    r113509 r118735  
    292292PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]'
    293293PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]'
     294PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]'
     295PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]'
    294296PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]'
    295297PASS SharedWorker.toString() is '[object SharedWorkerConstructor]'
  • trunk/LayoutTests/platform/gtk/fast/js/global-constructors-expected.txt

    r118469 r118735  
    296296PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]'
    297297PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]'
     298PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]'
    298299PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]'
    299300PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]'
  • trunk/LayoutTests/platform/mac/fast/js/global-constructors-expected.txt

    r118381 r118735  
    296296PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]'
    297297PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]'
     298PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]'
    298299PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]'
    299300PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]'
  • trunk/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt

    r118362 r118735  
    283283PASS SVGUseElement.toString() is '[object SVGUseElementConstructor]'
    284284PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]'
     285PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]'
    285286PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]'
    286287PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]'
  • trunk/LayoutTests/platform/win/fast/js/global-constructors-expected.txt

    r105514 r118735  
    292292PASS SVGVKernElement.toString() is '[object SVGVKernElementConstructor]'
    293293PASS SVGViewElement.toString() is '[object SVGViewElementConstructor]'
     294PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]'
     295PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]'
    294296PASS SVGZoomEvent.toString() is '[object SVGZoomEventConstructor]'
    295297PASS SharedWorker.toString() is '[object SharedWorkerConstructor]'
  • trunk/LayoutTests/svg/custom/global-constructors-expected.txt

    r118353 r118735  
    3333FAIL SVGFitToViewBox.toString() should be [object SVGFitToViewBoxConstructor]. Threw exception ReferenceError: Can't find variable: SVGFitToViewBox
    3434PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]'
    35 FAIL SVGViewSpec.toString() should be [object SVGViewSpecConstructor]. Threw exception ReferenceError: Can't find variable: SVGViewSpec
     35PASS SVGViewSpec.toString() is '[object SVGViewSpecConstructor]'
    3636FAIL SVGURIReference.toString() should be [object SVGURIReferenceConstructor]. Threw exception ReferenceError: Can't find variable: SVGURIReference
    3737FAIL SVGCSSRule.toString() should be [object SVGCSSRuleConstructor]. Threw exception ReferenceError: Can't find variable: SVGCSSRule
  • trunk/LayoutTests/svg/dom/viewspec-parser.html

    r118734 r118735  
    1717        viewTarget: 1
    1818    };
    19    
     19
    2020    var preserveAspectRatioValues = [ "Min", "Max", "Mid" ];
    21    
     21
    2222    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))",
    2329      "svgView",
    2430      "svgView(",
    2531      "svgView()",
    2632      "svgView(" + String.fromCharCode(0),
    27       "svgView(" + String.fromCharCode(0) + ")",
    2833      "svgView(transform(scale(2));;)",
    2934      "svgView(transform(scale(2));x", // used to hang
     
    3237      "svgView(;;transform(scale(.5)))",
    3338      "svgView(transform(scale(.5));transform(scale(2));transform(scale(2)))",
     39
    3440      ];
    35    
    36    
     41
    3742    var characters = [
    3843        "0",
     
    5762        ","
    5863    ];
    59    
     64
    6065    function buildTestsToRun() {
    6166      for (var attribute in attributes) {
    6267
    6368          // Too few / too many arguments
    64           for (var i = 0; i < 20; i++) { //>
     69          for (var i = 0; i < 5; i++) { //>
    6570              var attributeString = "svgView(" + attribute + "(";
    6671              for (var j = 0; j < i; j++) { //>
     
    7479
    7580          // Random assortments of valid characters
    76           for (var i = 0; i < 100; i++) { //>
     81          for (var i = 0; i < 50; i++) { //>
    7782              var attributeString = "svgView(" + attribute + "(";
    7883              var count = Math.scriptedRandomInt(20);
     
    8287              testsToRun.push(attributeString);
    8388          }
    84          
     89
    8590          // attribute names that are "off by one"
    8691          var extraChar = attribute.charAt(attribute.length - 1);
    8792          testsToRun.push("svgView(" + attribute + extraChar + "(0, 0)");
    8893          testsToRun.push("svgView(" + attribute.substring(0, attribute.length - 1) + "(0, 0)");
    89          
     94
    9095          // Empty-ish attributes
    9196          testsToRun.push("svgView(" + attribute);
    9297          testsToRun.push("svgView(" + attribute + String.fromCharCode(0));
    93           testsToRun.push("svgView(" + attribute + "(" + String.fromCharCode(0) + ")");
    9498      }
    95      
    9699    }
    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
    98110    function viewSpecToString(viewSpec)
    99111    {
    100112        if (!viewSpec)
    101           return viewSpec;
    102        
     113          return undefined;
     114
    103115        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]";
    115128        return "svgView(" + attributes.join(";") + ")";
    116129    }
    117    
     130
    118131    var testNumber = 0;
    119132    var testString = "[initial view]"
    120    
     133
    121134    function makeURLRelative(url) {
    122135      return url.slice(url.indexOf("resources"));
     
    132145      embedElement.setAttribute("width", "100");
    133146      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;
    136149      embedElement.src = newURL;
    137       debug("Starting: " + makeURLRelative(embedElement.src));
    138150      document.body.appendChild(embedElement);
    139151    }
     
    143155      testFragment(testString);
    144156    }
    145    
     157
    146158    function continueFuzzing(event)
    147159    {
    148160        var embedElement = document.getElementById("object");
    149161        if (embedElement.contentDocument) {
    150           debug("Loaded:   " + makeURLRelative(embedElement.contentDocument.URL));
    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");
    152164        } else
    153165          debug("no svgdocument");
    154        
     166
    155167        if (testNumber < testsToRun.length)
    156168          testString = testsToRun[testNumber];
    157169        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);
    163179          return;
    164180        }
    165181        testNumber++;
    166        
     182
    167183        // this lets us out of the onload handler so we don't overrun the stack
    168184        window.setTimeout(startNextTest, 0);
     
    170186    if (window.layoutTestController)
    171187      layoutTestController.waitUntilDone();
    172    
     188
    173189    buildTestsToRun();
    174190    testFragment("");
  • trunk/Source/WebCore/CMakeLists.txt

    r118567 r118735  
    19771977        svg/SVGUseElement.cpp
    19781978        svg/SVGViewElement.cpp
     1979        svg/SVGViewSpec.cpp
    19791980        svg/SVGVKernElement.cpp
    1980         svg/SVGViewSpec.cpp
    19811981        svg/SVGZoomAndPan.cpp
    19821982        svg/SVGZoomEvent.cpp
     
    21362136        svg/SVGUseElement.idl
    21372137        svg/SVGViewElement.idl
     2138        svg/SVGViewSpec.idl
    21382139        svg/SVGVKernElement.idl
    21392140        svg/SVGZoomAndPan.idl
  • trunk/Source/WebCore/ChangeLog

    r118733 r118735  
     12012-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
    11782012-05-29  Kent Tamura  <tkent@chromium.org>
    2179
  • trunk/Source/WebCore/DerivedSources.cpp

    r118353 r118735  
    438438#include "JSSVGUnitTypes.cpp"
    439439#include "JSSVGUseElement.cpp"
     440#include "JSSVGVKernElement.cpp"
    440441#include "JSSVGViewElement.cpp"
    441 #include "JSSVGVKernElement.cpp"
     442#include "JSSVGViewSpec.cpp"
    442443#include "JSSVGZoomAndPan.cpp"
    443444#include "JSSVGZoomEvent.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r118226 r118735  
    576576    $(WebCore)/svg/SVGVKernElement.idl \
    577577    $(WebCore)/svg/SVGViewElement.idl \
     578    $(WebCore)/svg/SVGViewSpec.idl \
    578579    $(WebCore)/svg/SVGZoomAndPan.idl \
    579580    $(WebCore)/svg/SVGZoomEvent.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r118353 r118735  
    607607    $$PWD/svg/SVGViewElement.idl \
    608608    $$PWD/svg/SVGVKernElement.idl \
     609    $$PWD/svg/SVGViewSpec.idl \
    609610    $$PWD/svg/SVGZoomAndPan.idl \
    610611    $$PWD/svg/SVGZoomEvent.idl
  • trunk/Source/WebCore/GNUmakefile.list.am

    r118567 r118735  
    42034203        Source/WebCore/svg/properties/SVGAnimatedPropertyDescription.h \
    42044204        Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h \
    4205         Source/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h \
    42064205        Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h \
    42074206        Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h \
     
    53935392        DerivedSources/WebCore/JSSVGViewElement.cpp \
    53945393        DerivedSources/WebCore/JSSVGViewElement.h \
     5394        DerivedSources/WebCore/JSSVGViewSpec.cpp \
    53955395        DerivedSources/WebCore/JSSVGViewSpec.h \
    53965396        DerivedSources/WebCore/JSSVGVKernElement.cpp \
     
    55425542        $(WebCore)/svg/SVGVKernElement.idl \
    55435543        $(WebCore)/svg/SVGViewElement.idl \
     5544        $(WebCore)/svg/SVGViewSpec.idl \
    55445545        $(WebCore)/svg/SVGZoomAndPan.idl \
    55455546        $(WebCore)/svg/SVGZoomEvent.idl
  • trunk/Source/WebCore/Target.pri

    r118567 r118735  
    26352635    svg/properties/SVGAnimatedPropertyDescription.h \
    26362636    svg/properties/SVGAnimatedPropertyMacros.h \
    2637     svg/properties/SVGAnimatedPropertySynchronizer.h \
    26382637    svg/properties/SVGAnimatedPropertyTearOff.h \
    26392638    svg/properties/SVGAnimatedStaticPropertyTearOff.h \
  • trunk/Source/WebCore/WebCore.gyp/WebCore.gyp

    r118672 r118735  
    174174      '../svg/SVGTests.idl',
    175175      '../svg/SVGTransformable.idl',
    176       '../svg/SVGViewSpec.idl',
    177176
    178177      # FIXME: I don't know why these are excluded, either.
  • trunk/Source/WebCore/WebCore.gypi

    r118668 r118735  
    740740            'svg/properties/SVGAnimatedPropertyDescription.h',
    741741            'svg/properties/SVGAnimatedPropertyMacros.h',
    742             'svg/properties/SVGAnimatedPropertySynchronizer.h',
    743742            'svg/properties/SVGAnimatedPropertyTearOff.h',
    744743            'svg/properties/SVGAnimatedStaticPropertyTearOff.h',
     
    71697168            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGVKernElement.mm',
    71707169            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGVKernElementInternal.h',
     7170            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewSpec.dep',
     7171            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewSpec.mm',
    71717172            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewElement.dep',
    71727173            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMSVGViewElement.mm',
     
    81338134            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGViewElement.dep',
    81348135            '<(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',
    81358139            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGZoomAndPan.cpp',
    81368140            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSSVGZoomAndPan.h',
  • trunk/Source/WebCore/WebCore.order

    r117971 r118735  
    2934629346__ZN7WebCore8SVGTests27synchronizeRequiredFeaturesEPNS_10SVGElementE
    2934729347__ZNK7WebCore13SVGStringList13valueAsStringEv
    29348 __ZN7WebCore31SVGAnimatedPropertySynchronizerILb1EE11synchronizeEPNS_10SVGElementERKNS_13QualifiedNameERKN3WTF12AtomicStringE
    2934929348__ZN7WebCore8SVGTests29synchronizeRequiredExtensionsEPNS_10SVGElementE
    2935029349__ZN7WebCore8SVGTests25synchronizeSystemLanguageEPNS_10SVGElementE
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r118567 r118735  
    2183521835                        </File>
    2183621836                        <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
    2183721893                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSVGVKernElement.cpp"
    2183821894                                >
     
    7218372239                                </File>
    7218472240                                <File
    72185                                         RelativePath="..\svg\properties\SVGAnimatedPropertySynchronizer.h"
    72186                                         >
    72187                                 </File>
    72188                                 <File
    7218972241                                        RelativePath="..\svg\properties\SVGAnimatedPropertyTearOff.h"
    7219072242                                        >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r118624 r118735  
    138138                081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */; };
    139139                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, ); }; };
    141140                081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
    142141                081EBF3A0FD34F4100DA7559 /* SVGFilterBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */; };
     
    18051804                6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */; };
    18061805                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 */; };
    18071808                7134496D146941B300720312 /* SVGLengthContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7134496B146941B300720312 /* SVGLengthContext.cpp */; };
    18081809                7134496E146941B300720312 /* SVGLengthContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 7134496C146941B300720312 /* SVGLengthContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
    18091810                71537A01146BD9D7008BD615 /* SVGPathData.h in Headers */ = {isa = PBXBuildFile; fileRef = 715379FF146BD9D6008BD615 /* SVGPathData.h */; };
    18101811                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 */; };
    18111815                71A57DF1154BE25C0009D120 /* SVGPathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */; };
    18121816                71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; };
     
    18161820                71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */; };
    18171821                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 */; };
    18181824                72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; };
    18191825                750D029311D0E7F300BD1B27 /* RenderInputSpeech.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */; };
     
    68766882                                A8F46A910CB20A9D003A9670 /* DOMSVGViewElement.h in Copy Generated Headers */,
    68776883                                A80F3B5F0CCDCE24002DD990 /* DOMSVGViewElementInternal.h in Copy Generated Headers */,
     6884                                71904DE8156A631C001E1BA5 /* DOMSVGViewSpec.h in Copy Generated Headers */,
    68786885                                A8F46AFD0CB20A9D003A9670 /* DOMSVGZoomAndPan.h in Copy Generated Headers */,
     6886                                71904DEA156A633A001E1BA5 /* DOMSVGViewSpecInternal.h in Copy Generated Headers */,
    68796887                                A8F46A930CB20A9D003A9670 /* DOMSVGZoomEvent.h in Copy Generated Headers */,
    68806888                                A80F3BB10CCDCE24002DD990 /* DOMSVGZoomEventInternal.h in Copy Generated Headers */,
     
    70167024                081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutEngine.h; sourceTree = "<group>"; };
    70177025                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>"; };
    70197026                081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyInfo.h; sourceTree = "<group>"; };
    70207027                081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilterBuilder.cpp; sourceTree = "<group>"; };
     
    88538860                6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextAttributes.cpp; sourceTree = "<group>"; };
    88548861                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>"; };
    88558863                7117445614BC34E200EE5FC8 /* SVGTextMetricsBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextMetricsBuilder.cpp; sourceTree = "<group>"; };
    88568864                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>"; };
    88578867                7134496B146941B300720312 /* SVGLengthContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthContext.cpp; sourceTree = "<group>"; };
    88588868                7134496C146941B300720312 /* SVGLengthContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthContext.h; sourceTree = "<group>"; };
     
    88608870                715379FF146BD9D6008BD615 /* SVGPathData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathData.h; sourceTree = "<group>"; };
    88618871                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>"; };
    88628873                71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; };
    88638874                71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; };
     
    88688879                71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedIntegerOptionalInteger.h; sourceTree = "<group>"; };
    88698880                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>"; };
    88708883                72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
    88718884                750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderInputSpeech.cpp; sourceTree = "<group>"; };
     
    1378913802                                088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */,
    1379013803                                088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */,
    13791                                 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */,
    1379213804                                088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */,
    1379313805                                08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */,
     
    1619616208                                859D62980AD888EF00012995 /* DOMSVGViewElement.mm */,
    1619716209                                A8E543C90CA9D1C10097D09B /* DOMSVGViewElementInternal.h */,
     16210                                71FE57EE156A620600ABEBD3 /* DOMSVGViewSpec.h */,
     16211                                71FE57EF156A620600ABEBD3 /* DOMSVGViewSpec.mm */,
     16212                                718512331568649800C40967 /* DOMSVGViewSpecInternal.h */,
    1619816213                                84852281119016A7006EDC7F /* DOMSVGVKernElement.h */,
    1619916214                                84852282119016A7006EDC7F /* DOMSVGVKernElement.mm */,
     
    1665316668                                859D62D90AD8892700012995 /* DOMSVGUseElementInternal.h */,
    1665416669                                859D62DA0AD8892700012995 /* DOMSVGViewElementInternal.h */,
     16670                                710867D51568644B00AA779B /* DOMSVGViewSpecInternal.h */,
    1665516671                                859D62DB0AD8892700012995 /* DOMSVGZoomEventInternal.h */,
    1665616672                                4429AB070CB84F81007647C5 /* DOMTextEventInternal.h */,
     
    1838218398                                B2FA3D2E0AB75A6F000E5AC4 /* JSSVGViewElement.cpp */,
    1838318399                                B2FA3D2F0AB75A6F000E5AC4 /* JSSVGViewElement.h */,
     18400                                7118FED215685CC60030B79A /* JSSVGViewSpec.cpp */,
     18401                                7118FED315685CC60030B79A /* JSSVGViewSpec.h */,
    1838418402                                848522791190162C006EDC7F /* JSSVGVKernElement.cpp */,
    1838518403                                8485227A1190162C006EDC7F /* JSSVGVKernElement.h */,
     
    2446624484                                088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */,
    2446724485                                088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */,
    24468                                 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */,
    2446924486                                088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */,
    2447024487                                08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */,
     
    2495824975                                71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */,
    2495924976                                0F3F0E5A157030C3006DA57F /* RenderGeometryMap.h in Headers */,
     24977                                7118FED515685CC60030B79A /* JSSVGViewSpec.h in Headers */,
     24978                                71FE57F0156A620600ABEBD3 /* DOMSVGViewSpec.h in Headers */,
     24979                                717A1981156A63BE00F9FE8C /* DOMSVGViewSpecInternal.h in Headers */,
    2496024980                        );
    2496124981                        runOnlyForDeploymentPostprocessing = 0;
     
    2799028010                                71DCB7011568197600862271 /* JSSVGZoomAndPan.cpp in Sources */,
    2799128011                                0F3F0E59157030C3006DA57F /* RenderGeometryMap.cpp in Sources */,
     28012                                7118FED415685CC60030B79A /* JSSVGViewSpec.cpp in Sources */,
     28013                                71FE57F1156A620600ABEBD3 /* DOMSVGViewSpec.mm in Sources */,
    2799228014                        );
    2799328015                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp

    r115670 r118735  
    4949void JSSVGLength::setValue(ExecState* exec, JSValue value)
    5050{
    51     if (impl()->role() == AnimValRole) {
     51    if (impl()->isReadOnly()) {
    5252        setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
    5353        return;
     
    7474JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec)
    7575{
    76     if (impl()->role() == AnimValRole) {
     76    if (impl()->isReadOnly()) {
    7777        setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
    7878        return jsUndefined();
  • trunk/Source/WebCore/bindings/objc/DOMSVG.h

    r91331 r118735  
    170170#import <WebCore/DOMSVGUseElement.h>
    171171#import <WebCore/DOMSVGViewElement.h>
     172#import <WebCore/DOMSVGViewSpec.h>
    172173#import <WebCore/DOMSVGZoomAndPan.h>
    173174#import <WebCore/DOMSVGZoomEvent.h>
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r118616 r118735  
    19571957                            if ($svgPropertyOrListPropertyType) {
    19581958                                if ($svgPropertyType) {
    1959                                     push(@implContent, "    if (impl->role() == AnimValRole) {\n");
     1959                                    push(@implContent, "    if (impl->isReadOnly()) {\n");
    19601960                                    push(@implContent, "        setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
    19611961                                    push(@implContent, "        return;\n");
     
    21302130                    push(@implContent, "    $implType* impl = static_cast<$implType*>(castedThis->impl());\n");
    21312131                    if ($svgPropertyType) {
    2132                         push(@implContent, "    if (impl->role() == AnimValRole) {\n");
     2132                        push(@implContent, "    if (impl->isReadOnly()) {\n");
    21332133                        push(@implContent, "        setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
    21342134                        push(@implContent, "        return JSValue::encode(jsUndefined());\n");
     
    31003100    }
    31013101
    3102     if ($codeGenerator->IsSVGAnimatedType($implClassName)) {
     3102    if ($codeGenerator->IsSVGAnimatedType($implClassName) or $implClassName eq "SVGViewSpec") {
    31033103        # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
    31043104        $value = "static_cast<" . GetNativeType($type) . ">($value)";
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r114887 r118735  
    13291329                    }
    13301330                }
    1331             } elsif ($codeGenerator->IsSVGAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) {
     1331            } elsif (($codeGenerator->IsSVGAnimatedType($implClassName) or $implClassName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) {
    13321332                my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType);
    13331333                $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)";
     
    14371437                    $implIncludes{"ExceptionCode.h"} = 1;
    14381438                    $getterContentHead = "$getterExpressionPrefix";
    1439                     push(@implContent, "    if (IMPL->role() == WebCore::AnimValRole) {\n");
     1439                    push(@implContent, "    if (IMPL->isReadOnly()) {\n");
    14401440                    push(@implContent, "        WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n");
    14411441                    push(@implContent, "        return;\n");
     
    16371637            } elsif ($svgPropertyType) {
    16381638                $implIncludes{"ExceptionCode.h"} = 1;
    1639                 push(@functionContent, "    if (IMPL->role() == WebCore::AnimValRole) {\n");
     1639                push(@functionContent, "    if (IMPL->isReadOnly()) {\n");
    16401640                push(@functionContent, "        WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n");
    16411641                if ($returnType eq "void") {
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r118726 r118735  
    946946    }
    947947
    948     if ($codeGenerator->IsSVGAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) {
     948    if (($codeGenerator->IsSVGAnimatedType($implClassName) or $implClassName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) {
    949949        AddToImplIncludes("V8$attrType.h");
    950950        my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
     
    10621062            AddToImplIncludes("ExceptionCode.h");
    10631063            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");
    10651065            push(@implContentDecls, "        V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());\n");
    10661066            push(@implContentDecls, "        return;\n");
     
    13961396            AddToImplIncludes("ExceptionCode.h");
    13971397            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");
    13991399            push(@implContentDecls, "        return V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());\n");
    14001400            my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
  • trunk/Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp

    r118063 r118735  
    5959    INC_STATS("DOM.SVGLength.value._set");
    6060    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
    61     if (wrapper->role() == AnimValRole) {
     61    if (wrapper->isReadOnly()) {
    6262        V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());
    6363        return;
     
    8383    INC_STATS("DOM.SVGLength.convertToSpecifiedUnits");
    8484    SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
    85     if (wrapper->role() == AnimValRole)
     85    if (wrapper->isReadOnly())
    8686        return V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());
    8787
  • trunk/Source/WebCore/page/DOMWindow.idl

    r118484 r118735  
    709709        attribute SVGUseElementConstructor SVGUseElement;
    710710        attribute SVGViewElementConstructor SVGViewElement;
    711 //      attribute SVGViewSpecConstructor SVGViewSpec;
     711        attribute SVGViewSpecConstructor SVGViewSpec;
    712712        attribute SVGZoomAndPanConstructor SVGZoomAndPan;
    713713
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp

    r112555 r118735  
    2828#include "PatternAttributes.h"
    2929#include "RenderSVGRoot.h"
     30#include "SVGFitToViewBox.h"
    3031#include "SVGRenderSupport.h"
    3132#include "SVGRenderingContext.h"
     
    216217        return false;
    217218
    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());
    219220
    220221    // Apply viewBox/objectBoundingBox transformations.
  • trunk/Source/WebCore/svg/SVGFitToViewBox.cpp

    r117195 r118735  
    8989}
    9090
    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 
    11191bool SVGFitToViewBox::isKnownAttribute(const QualifiedName& attrName)
    11292{
  • trunk/Source/WebCore/svg/SVGFitToViewBox.h

    r117195 r118735  
    2323
    2424#if ENABLE(SVG)
     25#include "Attribute.h"
     26#include "FloatRect.h"
    2527#include "QualifiedName.h"
     28#include "SVGNames.h"
     29#include "SVGPreserveAspectRatio.h"
    2630#include <wtf/HashSet.h>
    2731
     
    2933
    3034class AffineTransform;
    31 class Attribute;
    3235class Document;
    33 class FloatRect;
    34 class SVGPreserveAspectRatio;
    3536
    3637class SVGFitToViewBox {
    3738public:
    38     virtual ~SVGFitToViewBox() { }
    39 
    40     bool parseViewBox(Document*, const UChar*& start, const UChar* end, FloatRect& viewBox, bool validate = true);
    4139    static AffineTransform viewBoxToViewTransform(const FloatRect& viewBoxRect, const SVGPreserveAspectRatio&, float viewWidth, float viewHeight);
    4240
    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>&);
    4643
    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);
    4968
    5069private:
    51     bool parseViewBox(Document*, const String&, FloatRect&);
     70    static bool parseViewBox(Document*, const String&, FloatRect&);
    5271};
    5372
  • trunk/Source/WebCore/svg/SVGMarkerElement.cpp

    r117195 r118735  
    4040    if (!s_propertyInfo) {
    4141        s_propertyInfo = new SVGPropertyInfo(AnimatedEnumeration,
     42                                             PropertyIsReadWrite,
    4243                                             SVGNames::orientAttr,
    4344                                             orientTypeIdentifier(),
     
    154155    } else if (SVGLangSpace::parseAttribute(attribute)
    155156             || SVGExternalResourcesRequired::parseAttribute(attribute)
    156              || SVGFitToViewBox::parseAttribute(document(), attribute)) {
     157             || SVGFitToViewBox::parseAttribute(this, attribute)) {
    157158    } else
    158159        ASSERT_NOT_REACHED();
     
    240241
    241242    DEFINE_STATIC_LOCAL(AtomicString, autoString, ("auto"));
    242     SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, orientTypePropertyInfo()->attributeName, autoString);
     243    ownerType->m_orientType.synchronize(ownerType, orientTypePropertyInfo()->attributeName, autoString);
    243244}
    244245
     
    247248    ASSERT(contextElement);
    248249    SVGMarkerElement* ownerType = static_cast<SVGMarkerElement*>(contextElement);
    249     return SVGAnimatedProperty::lookupOrCreateWrapper<SVGMarkerElement, SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType, true>
     250    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGMarkerElement, SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType>
    250251           (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value);
    251252}
  • trunk/Source/WebCore/svg/SVGPathElement.cpp

    r117696 r118735  
    5353    if (!s_propertyInfo) {
    5454        s_propertyInfo = new SVGPropertyInfo(AnimatedPath,
     55                                             PropertyIsReadWrite,
    5556                                             SVGNames::dAttr,
    5657                                             SVGNames::dAttr.localName(),
     
    262263
    263264    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()) {
    265266            SVGPathSegList newList(PathSegUnalteredRole);
    266267            buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, newList, UnalteredParsing);
     
    278279SVGPathByteStream* SVGPathElement::pathByteStream() const
    279280{
    280     SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, true>(this, dPropertyInfo());
     281    SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(this, dPropertyInfo());
    281282    if (!property || !property->isAnimating())
    282283        return m_pathByteStream.get();
     
    289290    SVGPathElement* ownerType = static_cast<SVGPathElement*>(contextElement);
    290291
    291     if (SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, true>(ownerType, dPropertyInfo()))
     292    if (SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(ownerType, dPropertyInfo()))
    292293        return property;
    293294
     
    295296    buildSVGPathSegListFromByteStream(ownerType->m_pathByteStream.get(), ownerType, ownerType->m_pathSegList.value, UnalteredParsing);
    296297
    297     return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList, true>
     298    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList>
    298299           (ownerType, dPropertyInfo(), ownerType->m_pathSegList.value);
    299300}
     
    305306    if (!ownerType->m_pathSegList.shouldSynchronize)
    306307        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());
    308309}
    309310
  • trunk/Source/WebCore/svg/SVGPathSegWithContext.h

    r113184 r118735  
    4040            return 0;
    4141        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());
    4343        case PathSegNormalizedRole:
    4444            // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists!
  • trunk/Source/WebCore/svg/SVGPatternElement.cpp

    r117195 r118735  
    3535#include "RenderSVGResourcePattern.h"
    3636#include "SVGElementInstance.h"
     37#include "SVGFitToViewBox.h"
    3738#include "SVGNames.h"
    3839#include "SVGRenderSupport.h"
     
    144145             || SVGLangSpace::parseAttribute(attribute)
    145146             || SVGExternalResourcesRequired::parseAttribute(attribute)
    146              || SVGFitToViewBox::parseAttribute(document(), attribute)) {
     147             || SVGFitToViewBox::parseAttribute(this, attribute)) {
    147148    } else
    148149        ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/svg/SVGPolyElement.cpp

    r117195 r118735  
    4242    if (!s_propertyInfo) {
    4343        s_propertyInfo = new SVGPropertyInfo(AnimatedPoints,
     44                                             PropertyIsReadWrite,
    4445                                             SVGNames::pointsAttr,
    4546                                             SVGNames::pointsAttr.localName(),
     
    9192            document()->accessSVGExtensions()->reportError("Problem parsing points=\"" + value + "\"");
    9293
    93         if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGPolyElement, SVGAnimatedPointList, true>(this, pointsPropertyInfo()))
     94        if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGPolyElement, SVGAnimatedPointList>(this, pointsPropertyInfo()))
    9495            static_cast<SVGAnimatedPointList*>(wrapper)->detachListWrappers(newList.size());
    9596
     
    144145    if (!ownerType->m_points.shouldSynchronize)
    145146        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());
    147148}
    148149
     
    151152    ASSERT(contextElement);
    152153    SVGPolyElement* ownerType = static_cast<SVGPolyElement*>(contextElement);
    153     return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPolyElement, SVGAnimatedPointList, SVGPointList, true>
     154    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPolyElement, SVGAnimatedPointList, SVGPointList>
    154155           (ownerType, pointsPropertyInfo(), ownerType->m_points.value);
    155156}
  • trunk/Source/WebCore/svg/SVGRect.h

    r95901 r118735  
    4141        builder.append(' ');
    4242        builder.append(String::number(type.height()));
    43         builder.append(' ');
    4443        return builder.toString();
    4544    }
  • trunk/Source/WebCore/svg/SVGSVGElement.cpp

    r118353 r118735  
    4747#include "SVGAngle.h"
    4848#include "SVGElementInstance.h"
     49#include "SVGFitToViewBox.h"
    4950#include "SVGNames.h"
    5051#include "SVGPreserveAspectRatio.h"
     
    5354#include "SVGViewElement.h"
    5455#include "SVGViewSpec.h"
    55 #include "SVGZoomAndPan.h"
    5656#include "SVGZoomEvent.h"
    5757#include "ScriptEventListener.h"
     
    104104SVGSVGElement::~SVGSVGElement()
    105105{
     106    if (m_viewSpec)
     107        m_viewSpec->resetContextElement();
    106108    document()->unregisterForPageCacheSuspensionCallbacks(this);
    107109    // There are cases where removedFromDocument() is not called.
     
    171173}
    172174
    173 SVGViewSpec* SVGSVGElement::currentView() const
     175SVGViewSpec* SVGSVGElement::currentView()
    174176{
    175177    if (!m_viewSpec)
    176         m_viewSpec = adoptPtr(new SVGViewSpec(const_cast<SVGSVGElement*>(this)));
     178        m_viewSpec = SVGViewSpec::create(this);
    177179    return m_viewSpec.get();
    178180}
     
    270272               || SVGLangSpace::parseAttribute(attribute)
    271273               || SVGExternalResourcesRequired::parseAttribute(attribute)
    272                || SVGFitToViewBox::parseAttribute(document(), attribute)
     274               || SVGFitToViewBox::parseAttribute(this, attribute)
    273275               || SVGZoomAndPan::parseAttribute(this, attribute)) {
    274276    } else
     
    526528FloatRect SVGSVGElement::currentViewBoxRect() const
    527529{
    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();
    533532
    534533    FloatRect useViewBox = viewBox();
     
    647646AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
    648647{
    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;
    655659
    656660    return ctm;
     
    659663void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
    660664{
     665    RenderObject* renderer = this->renderer();
     666    SVGViewSpec* view = m_viewSpec.get();
     667    if (view)
     668        view->reset();
     669
    661670    bool hadUseCurrentView = m_useCurrentView;
     671    m_useCurrentView = false;
     672
    662673    if (fragmentIdentifier.startsWith("xpointer(")) {
    663674        // 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)) {
    669699        if (SVGViewElement* viewElement = anchorNode->hasTagName(SVGNames::viewTag) ? static_cast<SVGViewElement*>(anchorNode) : 0) {
    670700            SVGElement* element = SVGLocatable::nearestViewportElement(viewElement);
     
    672702                SVGSVGElement* svg = static_cast<SVGSVGElement*>(element);
    673703                svg->inheritViewAttributes(viewElement);
    674                 setUseCurrentView(true);
     704
     705                if (RenderObject* renderer = svg->renderer())
     706                    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    675707            }
    676708        }
    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    }
    688711
    689712    // FIXME: We need to decide which <svg> to focus on, and zoom to it.
     
    693716void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement)
    694717{
     718    SVGViewSpec* view = currentView();
     719    m_useCurrentView = true;
     720
    695721    if (viewElement->hasAttribute(SVGNames::viewBoxAttr))
    696         currentView()->setViewBoxBaseValue(viewElement->viewBox());
     722        view->setViewBoxBaseValue(viewElement->viewBox());
    697723    else
    698         currentView()->setViewBoxBaseValue(viewBox());
    699 
    700     SVGPreserveAspectRatio aspectRatio;
     724        view->setViewBoxBaseValue(viewBox());
     725
    701726    if (viewElement->hasAttribute(SVGNames::preserveAspectRatioAttr))
    702         aspectRatio = viewElement->preserveAspectRatioBaseValue();
     727        view->setPreserveAspectRatioBaseValue(viewElement->preserveAspectRatioBaseValue());
    703728    else
    704         aspectRatio = preserveAspectRatioBaseValue();
    705     currentView()->setPreserveAspectRatioBaseValue(aspectRatio);
     729        view->setPreserveAspectRatioBaseValue(preserveAspectRatioBaseValue());
    706730
    707731    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
    714737void SVGSVGElement::documentWillSuspendForPageCache()
    715738{
  • trunk/Source/WebCore/svg/SVGSVGElement.h

    r118353 r118735  
    7373
    7474    bool useCurrentView() const { return m_useCurrentView; }
    75     void setUseCurrentView(bool currentView) { m_useCurrentView = currentView; }
    76 
    77     SVGViewSpec* currentView() const;
     75    SVGViewSpec* currentView();
    7876
    7977    enum ConsiderCSSMode {
     
    192190    RefPtr<SMILTimeContainer> m_timeContainer;
    193191    FloatPoint m_translation;
    194     mutable OwnPtr<SVGViewSpec> m_viewSpec;
     192    RefPtr<SVGViewSpec> m_viewSpec;
    195193};
    196194
  • trunk/Source/WebCore/svg/SVGSVGElement.idl

    r107304 r118735  
    4949        readonly attribute float screenPixelToMillimeterX;
    5050        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;
    5453                 attribute float currentScale
    5554                     /*setter raises(DOMException)*/;
  • trunk/Source/WebCore/svg/SVGSymbolElement.cpp

    r117195 r118735  
    7777    if (SVGExternalResourcesRequired::parseAttribute(attribute))
    7878        return;
    79     if (SVGFitToViewBox::parseAttribute(document(), attribute))
     79    if (SVGFitToViewBox::parseAttribute(this, attribute))
    8080        return;
    8181
  • trunk/Source/WebCore/svg/SVGTests.cpp

    r117195 r118735  
    3939    if (!s_propertyInfo) {
    4040        s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown,
     41                                             PropertyIsReadWrite,
    4142                                             SVGNames::requiredFeaturesAttr,
    4243                                             SVGNames::requiredFeaturesAttr.localName(),
     
    5354    if (!s_propertyInfo) {
    5455        s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown,
     56                                             PropertyIsReadWrite,
    5557                                             SVGNames::requiredExtensionsAttr,
    5658                                             SVGNames::requiredExtensionsAttr.localName(),
     
    6769    if (!s_propertyInfo) {
    6870        s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown,
     71                                             PropertyIsReadWrite,
    6972                                             SVGNames::systemLanguageAttr,
    7073                                             SVGNames::systemLanguageAttr.localName(),
     
    174177        return;
    175178    AtomicString value(m_requiredFeatures.value.valueAsString());
    176     SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, requiredFeaturesPropertyInfo()->attributeName, value);
     179    m_requiredFeatures.synchronize(contextElement, requiredFeaturesPropertyInfo()->attributeName, value);
    177180}
    178181
     
    183186        return;
    184187    AtomicString value(m_requiredExtensions.value.valueAsString());
    185     SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, requiredExtensionsPropertyInfo()->attributeName, value);
     188    m_requiredExtensions.synchronize(contextElement, requiredExtensionsPropertyInfo()->attributeName, value);
    186189}
    187190
     
    192195        return;
    193196    AtomicString value(m_systemLanguage.value.valueAsString());
    194     SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, systemLanguagePropertyInfo()->attributeName, value);
     197    m_systemLanguage.synchronize(contextElement, systemLanguagePropertyInfo()->attributeName, value);
    195198}
    196199
  • trunk/Source/WebCore/svg/SVGTextContentElement.cpp

    r117225 r118735  
    4545    if (!s_propertyInfo) {
    4646        s_propertyInfo = new SVGPropertyInfo(AnimatedLength,
     47                                             PropertyIsReadWrite,
    4748                                             SVGNames::textLengthAttr,
    4849                                             SVGNames::textLengthAttr.localName(),
     
    8182        return;
    8283    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);
    8485}
    8586
     
    8889    ASSERT(contextElement);
    8990    SVGTextContentElement* ownerType = static_cast<SVGTextContentElement*>(contextElement);
    90     return SVGAnimatedProperty::lookupOrCreateWrapper<SVGTextContentElement, SVGAnimatedLength, SVGLength, true>
     91    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGTextContentElement, SVGAnimatedLength, SVGLength>
    9192           (ownerType, textLengthPropertyInfo(), ownerType->m_textLength.value);
    9293}
  • trunk/Source/WebCore/svg/SVGViewElement.cpp

    r118353 r118735  
    8484    if (SVGExternalResourcesRequired::parseAttribute(attribute))
    8585        return;
    86     if (SVGFitToViewBox::parseAttribute(document(), attribute))
     86    if (SVGFitToViewBox::parseAttribute(this, attribute))
    8787        return;
    8888    if (SVGZoomAndPan::parseAttribute(this, attribute))
  • trunk/Source/WebCore/svg/SVGViewElement.h

    r118353 r118735  
    4545
    4646    SVGStringList& viewTarget() { return m_viewTarget; }
    47 
    4847    SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; }
    4948    void setZoomAndPan(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); }
  • trunk/Source/WebCore/svg/SVGViewSpec.cpp

    r118353 r118735  
    2424
    2525#include "Document.h"
     26#include "SVGAnimatedTransformList.h"
     27#include "SVGFitToViewBox.h"
    2628#include "SVGNames.h"
    2729#include "SVGParserUtilities.h"
     
    3133namespace WebCore {
    3234
    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'.
     36const 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'.
     51const 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'.
     67const 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}
    4180
    4281SVGViewSpec::SVGViewSpec(SVGElement* contextElement)
     
    4584{
    4685    ASSERT(m_contextElement);
    47     registerAnimatedPropertiesForSVGViewSpec();
     86}
     87
     88const AtomicString& SVGViewSpec::viewBoxIdentifier()
     89{
     90    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGViewSpecViewBoxAttribute"));
     91    return s_identifier;
     92}
     93
     94const AtomicString& SVGViewSpec::preserveAspectRatioIdentifier()
     95{
     96    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGViewSpecPreserveAspectRatioAttribute"));
     97    return s_identifier;
     98}
     99
     100const AtomicString& SVGViewSpec::transformIdentifier()
     101{
     102    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGViewSpecTransformAttribute"));
     103    return s_identifier;
     104}
     105
     106void SVGViewSpec::setZoomAndPan(unsigned short, ExceptionCode& ec)
     107{
     108    // SVGViewSpec and all of its content is read-only.
     109    ec = NO_MODIFICATION_ALLOWED_ERR;
    48110}
    49111
    50112void SVGViewSpec::setTransformString(const String& transform)
    51113{
    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
     126String SVGViewSpec::transformString() const
     127{
     128    return SVGPropertyTraits<SVGTransformList>::toString(m_transform);
     129}
     130
     131String SVGViewSpec::viewBoxString() const
     132{
     133    return SVGPropertyTraits<FloatRect>::toString(viewBoxBaseValue());
    63134}
    64135
     
    70141}
    71142
    72 void SVGViewSpec::setViewTargetString(const String& viewTargetString)
    73 {
    74     m_viewTargetString = viewTargetString;
     143String SVGViewSpec::preserveAspectRatioString() const
     144{
     145    return SVGPropertyTraits<SVGPreserveAspectRatio>::toString(preserveAspectRatioBaseValue());
    75146}
    76147
    77148SVGElement* SVGViewSpec::viewTarget() const
    78149{
     150    if (!m_contextElement)
     151        return 0;
    79152    return static_cast<SVGElement*>(m_contextElement->treeScope()->getElementById(m_viewTargetString));
     153}
     154
     155SVGTransformListPropertyTearOff* 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
     161PassRefPtr<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
     168PassRefPtr<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
     175PassRefPtr<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
     182void SVGViewSpec::reset()
     183{
     184    m_zoomAndPan = SVGZoomAndPanMagnify;
     185    m_transform.clear();
     186    m_viewBox = FloatRect();
     187    m_preserveAspectRatio = SVGPreserveAspectRatio();
     188    m_viewTargetString = emptyString();
    80189}
    81190
     
    92201    const UChar* end = currViewSpec + viewSpec.length();
    93202
    94     if (currViewSpec >= end)
     203    if (currViewSpec >= end || !m_contextElement)
    95204        return false;
    96205
     
    109218                currViewSpec++;
    110219                FloatRect viewBox;
    111                 if (!parseViewBox(m_contextElement->document(), currViewSpec, end, viewBox, false))
     220                if (!SVGFitToViewBox::parseViewBox(m_contextElement->document(), currViewSpec, end, viewBox, false))
    112221                    return false;
    113222                setViewBoxBaseValue(viewBox);
  • trunk/Source/WebCore/svg/SVGViewSpec.h

    r118353 r118735  
    3131
    3232class SVGElement;
     33class SVGTransformListPropertyTearOff;
    3334
    34 class SVGViewSpec : public SVGZoomAndPan,
    35                     public SVGFitToViewBox {
    36     WTF_MAKE_NONCOPYABLE(SVGViewSpec);
     35class SVGViewSpec : public RefCounted<SVGViewSpec>
     36                  , public SVGZoomAndPan
     37                  , public SVGFitToViewBox {
    3738public:
    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    }
    3948
    4049    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;
    4157
    4258    void setTransformString(const String&);
    43     SVGTransformList transform() const { return m_transform; }
    44     SVGTransformList transformBaseValue() const { return m_transform; }
     59    String transformString() const;
    4560
    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; }
    5162    String viewTargetString() const { return m_viewTargetString; }
    52     SVGElement* viewTarget() const;
    5363
    5464    SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; }
     65    void setZoomAndPan(unsigned short zoomAndPan) { setZoomAndPanBaseValue(zoomAndPan); }
    5566    void setZoomAndPan(unsigned short, ExceptionCode&);
    5667    void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); }
    5768
     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
    5896private:
     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
    59111    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;
    65113
    66114    SVGTransformList m_transform;
     115    FloatRect m_viewBox;
     116    SVGPreserveAspectRatio m_preserveAspectRatio;
    67117    String m_viewTargetString;
    68     SVGZoomAndPanType m_zoomAndPan;
    69118};
    70119
  • trunk/Source/WebCore/svg/SVGViewSpec.idl

    r89269 r118735  
    2626module svg {
    2727
     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.
    2830    interface [
    29         Conditional=SVG
    30     ] SVGViewSpec : SVGZoomAndPan, SVGFitToViewBox
    31     {
     31        Conditional=SVG,
     32        JSGenerateToJSObject
     33    ] SVGViewSpec {
    3234          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;
    3848    };
    3949
  • trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h

    r116451 r118735  
    3737    AnimatedPropertyType animatedPropertyType() const { return m_animatedPropertyType; }
    3838    bool isAnimating() const { return m_isAnimating; }
     39    bool isReadOnly() const { return m_isReadOnly; }
     40    void setIsReadOnly() { m_isReadOnly = true; }
    3941
    4042    void commitChange()
     
    6769    }
    6870
    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>
    9872    static PassRefPtr<TearOffType> lookupOrCreateWrapper(OwnerType* element, const SVGPropertyInfo* info, PropertyType& property)
    9973    {
    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);
    10184    }
    10285
    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    }
    10693
    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>
    12695    static TearOffType* lookupWrapper(const OwnerType* element, const SVGPropertyInfo* info)
    12796    {
    128         return LookupHelper<TearOffType, isDerivedFromSVGElement>::lookupWrapper(element, info);
     97        return lookupWrapper<OwnerType, TearOffType>(const_cast<OwnerType*>(element), info);
    12998    }
    13099
     
    135104        , m_animatedPropertyType(animatedPropertyType)
    136105        , m_isAnimating(false)
     106        , m_isReadOnly(false)
    137107    {
    138108    }
     
    151121protected:
    152122    bool m_isAnimating;
     123    bool m_isReadOnly;
    153124};
    154125
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h

    r95901 r118735  
    2424
    2525#if ENABLE(SVG)
     26#include "SVGAnimatedProperty.h"
    2627#include "SVGAttributeToPropertyMap.h"
    2728#include "SVGPropertyTraits.h"
     
    2930
    3031namespace WebCore {
    31 
    32 // IsDerivedFromSVGElement implementation
    33 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 };
    4932
    5033// SVGSynchronizableAnimatedProperty implementation
     
    6952        , shouldSynchronize(false)
    7053    {
     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);
    7170    }
    7271
     
    103102    DEFINE_STATIC_LOCAL(const SVGPropertyInfo, s_propertyInfo, \
    104103                        (AnimatedPropertyTypeEnum, \
     104                         PropertyIsReadWrite, \
    105105                         DOMAttribute, \
    106106                         SVGDOMAttributeIdentifier, \
     
    125125    PropertyType& LowerProperty() const \
    126126    { \
    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())) { \
    128128            if (wrapper->isAnimating()) \
    129129                return wrapper->currentAnimatedValue(); \
     
    154154            return; \
    155155        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); \
    157157    } \
    158158\
     
    161161        ASSERT(maskedOwnerType); \
    162162        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); \
    164164    } \
    165165\
     
    180180void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \
    181181{ \
    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())) \
    183183        wrapper->detachListWrappers(newListSize); \
    184184}
  • trunk/Source/WebCore/svg/properties/SVGAttributeToPropertyMap.h

    r104369 r118735  
    2222
    2323#if ENABLE(SVG)
    24 #include "QualifiedName.h"
    25 #include "SVGAnimatedPropertySynchronizer.h"
     24#include "SVGPropertyInfo.h"
    2625#include <wtf/HashMap.h>
    2726
     
    3029class SVGAnimatedProperty;
    3130class SVGElement;
    32 struct SVGPropertyInfo;
    3331
    3432class SVGAttributeToPropertyMap {
  • trunk/Source/WebCore/svg/properties/SVGListProperty.h

    r113184 r118735  
    416416    }
    417417
    418     virtual SVGPropertyRole role() const { return m_role; }
    419 
    420418    PropertyType& values()
    421419    {
  • trunk/Source/WebCore/svg/properties/SVGListPropertyTearOff.h

    r110835 r118735  
    3838    typedef typename SVGAnimatedListPropertyTearOff<PropertyType>::ListWrapperCache ListWrapperCache;
    3939
     40    using Base::m_role;
    4041    using Base::m_values;
    4142    using Base::m_wrappers;
     
    116117    }
    117118
     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
    118128    virtual void commitChange()
    119129    {
  • trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h

    r110835 r118735  
    127127    SVGPathElement* contextElement() const;
    128128
     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
    129140    virtual void commitChange()
    130141    {
  • trunk/Source/WebCore/svg/properties/SVGProperty.h

    r95901 r118735  
    3636    virtual ~SVGProperty() { }
    3737
    38     virtual SVGPropertyRole role() const = 0;
     38    virtual bool isReadOnly() const = 0;
    3939    virtual void commitChange() = 0;
    4040};
  • trunk/Source/WebCore/svg/properties/SVGPropertyInfo.h

    r112224 r118735  
    2929class SVGAnimatedProperty;
    3030
     31enum AnimatedPropertyState {
     32    PropertyIsReadWrite,
     33    PropertyIsReadOnly
     34};
     35
    3136enum AnimatedPropertyType {
    3237    AnimatedAngle,
     
    5459    typedef PassRefPtr<SVGAnimatedProperty> (*LookupOrCreateWrapperForAnimatedProperty)(void*);
    5560
    56     SVGPropertyInfo(AnimatedPropertyType newType, const QualifiedName& newAttributeName,
     61    SVGPropertyInfo(AnimatedPropertyType newType, AnimatedPropertyState newState, const QualifiedName& newAttributeName,
    5762                    const AtomicString& newPropertyIdentifier, SynchronizeProperty newSynchronizeProperty,
    5863                    LookupOrCreateWrapperForAnimatedProperty newLookupOrCreateWrapperForAnimatedProperty)
    5964        : animatedPropertyType(newType)
     65        , animatedPropertyState(newState)
    6066        , attributeName(newAttributeName)
    6167        , propertyIdentifier(newPropertyIdentifier)
     
    6672
    6773    AnimatedPropertyType animatedPropertyType;
     74    AnimatedPropertyState animatedPropertyState;
    6875    const QualifiedName& attributeName;
    6976    const AtomicString& propertyIdentifier;
  • trunk/Source/WebCore/svg/properties/SVGPropertyTearOff.h

    r115518 r118735  
    9797    }
    9898
    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    }
    100107
    101108protected:
  • trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h

    r110835 r118735  
    3434    typedef SVGPropertyTearOff<ListItemType> ListItemTearOff;
    3535
     36    using Base::m_role;
    3637    using Base::m_values;
    3738
     
    8586    }
    8687
     88    virtual bool isReadOnly() const
     89    {
     90        return m_role == AnimValRole;
     91    }
     92
    8793    virtual void commitChange()
    8894    {
  • trunk/Source/WebKit/mac/ChangeLog

    r118705 r118735  
     12012-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
    1102012-05-25  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
    211
  • trunk/Source/WebKit/mac/MigrateHeaders.make

    r112424 r118735  
    464464    $(PRIVATE_HEADERS_DIR)/DOMSVGViewElement.h \
    465465    $(INTERNAL_HEADERS_DIR)/DOMSVGViewElementInternal.h \
     466    $(PRIVATE_HEADERS_DIR)/DOMSVGViewSpec.h \
     467    $(INTERNAL_HEADERS_DIR)/DOMSVGViewSpecInternal.h \
    466468    $(PRIVATE_HEADERS_DIR)/DOMSVGZoomAndPan.h \
    467469    $(PRIVATE_HEADERS_DIR)/DOMSVGZoomEvent.h \
Note: See TracChangeset for help on using the changeset viewer.