WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch v6
bug-15494-20120523094253.patch (text/plain), 45.44 KB, created by
Nikolas Zimmermann
on 2012-05-23 00:42:10 PDT
(
hide
)
Description:
Patch v6
Filename:
MIME Type:
Creator:
Nikolas Zimmermann
Created:
2012-05-23 00:42:10 PDT
Size:
45.44 KB
patch
obsolete
>Subversion Revision: 118140 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6cb558e5c5bb7565ea739a67fa5548f0aa44ca0a..71289e3f9ebfc28f112736231b74b1b194e0a8b6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,100 @@ >+2012-05-23 Nikolas Zimmermann <nzimmermann@rim.com> >+ >+ SVGZoomAndPan constants are missing from window object >+ https://bugs.webkit.org/show_bug.cgi?id=15494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Generate the SVGZoomAndPanConstructor, so that the constants defined in the IDL >+ can be reached from the bindings. Provide a stub-implementation of ref/deref >+ that's never used, as we don't actually use JSSVGZoomAndPan which needs this, but >+ only the JSSVGZoomAndPanConstructor. >+ >+ Add a new IDL flag "SuppressToJSObject" which disables generation of toJS/toV8 >+ methods for classes that are only used in SVGs interfaces via multiple inheritance. >+ This affects: SVGFitToViewBox, SVGTests, SVGLangSapce, SVGExternalResourcesRequired, etc. >+ >+ Unlike those classes SVGZoomAndPan defines constants, and thus needs a generated Constructor. >+ That requires us to build JSSVGZoomAndPan.* (JSSVGFitToViewBox/etc. is generated, but not built!). >+ Unfortunately this causes compilation problems on Windows, as it builds all sources in a single-file. >+ MSVC can't decide wheteher it should call toJS(Node*) or toJS(SVGZoomAndPan*) for a SVGSVGElement. >+ To avoid these problems stop generating toJS/toV8 completely for all SVG MI types. They were >+ never used before, so there's no point in actually generating them, as it's now causing problems. >+ >+ This is a preparation towards bug 15495, which covers implementing >+ SVGSVGElement.currentView and the SVGViewSpec interface. >+ >+ * CMakeLists.txt: >+ * DerivedSources.cpp: >+ * DerivedSources.pri: >+ * GNUmakefile.list.am: >+ * WebCore.gyp/WebCore.gyp: >+ * WebCore.vcproj/WebCore.vcproj: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (ShouldGenerateToJSDeclaration): >+ (ShouldGenerateToJSImplementation): >+ (GenerateHeader): >+ (GenerateImplementation): >+ * bindings/scripts/CodeGeneratorV8.pm: >+ (GenerateHeader): >+ * bindings/scripts/IDLAttributes.txt: >+ * gyp/WebCore.gyp: >+ * page/DOMWindow.idl: >+ * svg/SVGDocument.cpp: >+ (WebCore::SVGDocument::zoomAndPanEnabled): >+ * svg/SVGExternalResourcesRequired.idl: >+ * svg/SVGFitToViewBox.idl: >+ * svg/SVGLangSpace.idl: >+ * svg/SVGLocatable.idl: >+ * svg/SVGRenderingIntent.idl: >+ * svg/SVGSVGElement.cpp: >+ (WebCore::SVGSVGElement::SVGSVGElement): >+ (WebCore::SVGSVGElement::parseAttribute): >+ (WebCore::SVGSVGElement::viewBoxToViewTransform): >+ (WebCore::SVGSVGElement::setupInitialView): >+ (WebCore::SVGSVGElement::inheritViewAttributes): >+ * svg/SVGSVGElement.h: >+ (SVGSVGElement): >+ (WebCore::SVGSVGElement::useCurrentView): >+ (WebCore::SVGSVGElement::setUseCurrentView): >+ (WebCore::SVGSVGElement::zoomAndPan): >+ (WebCore::SVGSVGElement::setZoomAndPan): >+ * svg/SVGStylable.idl: >+ * svg/SVGTests.idl: >+ * svg/SVGURIReference.idl: >+ * svg/SVGUnitTypes.idl: >+ * svg/SVGViewElement.cpp: >+ (WebCore::SVGViewElement::SVGViewElement): >+ (WebCore::SVGViewElement::parseAttribute): >+ * svg/SVGViewElement.h: >+ (SVGViewElement): >+ (WebCore::SVGViewElement::zoomAndPan): >+ (WebCore::SVGViewElement::setZoomAndPan): >+ * svg/SVGViewSpec.cpp: >+ (WebCore::SVGViewSpec::SVGViewSpec): >+ (WebCore::SVGViewSpec::setTransformString): >+ (WebCore::SVGViewSpec::parseViewSpec): >+ * svg/SVGViewSpec.h: >+ (SVGViewSpec): >+ (WebCore::SVGViewSpec::transformBaseValue): >+ (WebCore::SVGViewSpec::zoomAndPan): >+ (WebCore::SVGViewSpec::setZoomAndPanBaseValue): >+ * svg/SVGZoomAndPan.cpp: >+ (WebCore::SVGZoomAndPan::isKnownAttribute): >+ (WebCore::SVGZoomAndPan::addSupportedAttributes): >+ (WebCore): >+ (WebCore::SVGZoomAndPan::parseZoomAndPan): >+ (WebCore::SVGZoomAndPan::ref): >+ (WebCore::SVGZoomAndPan::deref): >+ (WebCore::SVGZoomAndPan::setZoomAndPan): >+ * svg/SVGZoomAndPan.h: >+ (SVGZoomAndPan): >+ (WebCore::SVGZoomAndPan::parseFromNumber): >+ (WebCore::SVGZoomAndPan::parseAttribute): >+ (WebCore::SVGZoomAndPan::zoomAndPan): >+ * svg/SVGZoomAndPan.idl: >+ > 2012-05-23 Ryosuke Niwa <rniwa@webkit.org> > > Fix a typo per Darin's comment. >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 34484e8c52f3e00a06c5a2af2921355f4ae9bac5..f9991407f3daac683ae07ad839631a6a2064ea8e 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -2131,6 +2131,7 @@ IF (ENABLE_SVG) > svg/SVGUseElement.idl > svg/SVGViewElement.idl > svg/SVGVKernElement.idl >+ svg/SVGZoomAndPan.idl > svg/SVGZoomEvent.idl > ) > >diff --git a/Source/WebCore/DerivedSources.cpp b/Source/WebCore/DerivedSources.cpp >index 988d58267d7e935ef6b027c49129fad81b8b10dc..ff343440d9c4720b76978c96face9254b168a449 100644 >--- a/Source/WebCore/DerivedSources.cpp >+++ b/Source/WebCore/DerivedSources.cpp >@@ -438,6 +438,7 @@ > #include "JSSVGUseElement.cpp" > #include "JSSVGViewElement.cpp" > #include "JSSVGVKernElement.cpp" >+#include "JSSVGZoomAndPan.cpp" > #include "JSSVGZoomEvent.cpp" > #include "JSText.cpp" > #include "JSTextEvent.cpp" >diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri >index ad0783f0ea253037a8003bb4fec9f3945f7cd169..dc352128460e13f60316e01b5cc5bc38c4b3e093 100644 >--- a/Source/WebCore/DerivedSources.pri >+++ b/Source/WebCore/DerivedSources.pri >@@ -465,7 +465,6 @@ v8 { > > contains(DEFINES, ENABLE_SVG=1) { > IDL_BINDINGS += \ >- $$PWD/svg/SVGZoomEvent.idl \ > $$PWD/svg/SVGAElement.idl \ > $$PWD/svg/SVGAltGlyphDefElement.idl \ > $$PWD/svg/SVGAltGlyphElement.idl \ >@@ -605,7 +604,9 @@ contains(DEFINES, ENABLE_SVG=1) { > $$PWD/svg/SVGUnitTypes.idl \ > $$PWD/svg/SVGUseElement.idl \ > $$PWD/svg/SVGViewElement.idl \ >- $$PWD/svg/SVGVKernElement.idl >+ $$PWD/svg/SVGVKernElement.idl \ >+ $$PWD/svg/SVGZoomAndPan.idl \ >+ $$PWD/svg/SVGZoomEvent.idl > } > > contains(DEFINES, ENABLE_VIDEO_TRACK=1) { >diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am >index 6a06c0df7a68ffde0d0774b6e65d69448446e6fe..bd0d04a466739e3821704e06591c3a5e5fc84ba9 100644 >--- a/Source/WebCore/GNUmakefile.list.am >+++ b/Source/WebCore/GNUmakefile.list.am >@@ -5385,6 +5385,7 @@ webcore_built_sources += \ > DerivedSources/WebCore/JSSVGViewSpec.h \ > DerivedSources/WebCore/JSSVGVKernElement.cpp \ > DerivedSources/WebCore/JSSVGVKernElement.h \ >+ DerivedSources/WebCore/JSSVGZoomAndPan.cpp \ > DerivedSources/WebCore/JSSVGZoomAndPan.h \ > DerivedSources/WebCore/JSSVGZoomEvent.cpp \ > DerivedSources/WebCore/JSSVGZoomEvent.h >@@ -5530,6 +5531,7 @@ dom_binding_idls += \ > $(WebCore)/svg/SVGUseElement.idl \ > $(WebCore)/svg/SVGVKernElement.idl \ > $(WebCore)/svg/SVGViewElement.idl \ >+ $(WebCore)/svg/SVGZoomAndPan.idl \ > $(WebCore)/svg/SVGZoomEvent.idl > endif # END ENABLE_SVG > >diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp >index ee1ca009b9472878974b0ce4c80864d2d651bc08..309e33584b211d8357206389345d2da95558ce03 100644 >--- a/Source/WebCore/WebCore.gyp/WebCore.gyp >+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp >@@ -174,7 +174,6 @@ > '../svg/SVGTests.idl', > '../svg/SVGTransformable.idl', > '../svg/SVGViewSpec.idl', >- '../svg/SVGZoomAndPan.idl', > > # FIXME: I don't know why these are excluded, either. > # Someone (me?) should figure it out and add appropriate comments. >diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj >index 846e631f01377899a5a70a43e5b539b561211fa5..ed50c75fb459861a35195135e21aed0864c1193e 100755 >--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj >+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj >@@ -21834,6 +21834,63 @@ > > > </File> > <File >+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSVGZoomAndPan.cpp" >+ > >+ <FileConfiguration >+ Name="Debug|Win32" >+ ExcludedFromBuild="true" >+ > >+ <Tool >+ Name="VCCLCompilerTool" >+ /> >+ </FileConfiguration> >+ <FileConfiguration >+ Name="Release|Win32" >+ ExcludedFromBuild="true" >+ > >+ <Tool >+ Name="VCCLCompilerTool" >+ /> >+ </FileConfiguration> >+ <FileConfiguration >+ Name="Debug_Cairo_CFLite|Win32" >+ ExcludedFromBuild="true" >+ > >+ <Tool >+ Name="VCCLCompilerTool" >+ /> >+ </FileConfiguration> >+ <FileConfiguration >+ Name="Release_Cairo_CFLite|Win32" >+ ExcludedFromBuild="true" >+ > >+ <Tool >+ Name="VCCLCompilerTool" >+ /> >+ </FileConfiguration> >+ <FileConfiguration >+ Name="Debug_All|Win32" >+ ExcludedFromBuild="true" >+ > >+ <Tool >+ Name="VCCLCompilerTool" >+ /> >+ </FileConfiguration> >+ <FileConfiguration >+ Name="Production|Win32" >+ ExcludedFromBuild="true" >+ > >+ <Tool >+ Name="VCCLCompilerTool" >+ /> >+ </FileConfiguration> >+ </File> >+ <File >+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSVGZoomAndPan.h" >+ > >+ </File> >+ >+ <File > RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSVGZoomEvent.cpp" > > > <FileConfiguration >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 5bf2e757fa70e330e883bd9c2bded82b6d3ba420..0cdde6fb096e00b873c168f9a637b803d9eaf4b6 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1810,6 +1810,8 @@ > 71A57DF1154BE25C0009D120 /* SVGPathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */; }; > 71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; }; > 71CC7A20152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */; }; >+ 71DCB7011568197600862271 /* JSSVGZoomAndPan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71DCB6FF1568197600862271 /* JSSVGZoomAndPan.cpp */; }; >+ 71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */ = {isa = PBXBuildFile; fileRef = 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */; }; > 71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */; }; > 71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; }; >@@ -8852,6 +8854,8 @@ > 71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; }; > 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; }; > 71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedEnumeration.cpp; sourceTree = "<group>"; }; >+ 71DCB6FF1568197600862271 /* JSSVGZoomAndPan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGZoomAndPan.cpp; sourceTree = "<group>"; }; >+ 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGZoomAndPan.h; sourceTree = "<group>"; }; > 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedIntegerOptionalInteger.cpp; sourceTree = "<group>"; }; > 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedIntegerOptionalInteger.h; sourceTree = "<group>"; }; > 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumerationPropertyTearOff.h; sourceTree = "<group>"; }; >@@ -18365,6 +18369,8 @@ > B2FA3D2F0AB75A6F000E5AC4 /* JSSVGViewElement.h */, > 848522791190162C006EDC7F /* JSSVGVKernElement.cpp */, > 8485227A1190162C006EDC7F /* JSSVGVKernElement.h */, >+ 71DCB6FF1568197600862271 /* JSSVGZoomAndPan.cpp */, >+ 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */, > B2FA3D300AB75A6F000E5AC4 /* JSSVGZoomEvent.cpp */, > B2FA3D310AB75A6F000E5AC4 /* JSSVGZoomEvent.h */, > ); >@@ -24924,6 +24930,7 @@ > FDB052E01561A42C00B500D6 /* AudioSummingJunction.h in Headers */, > 371941971566B37200A276D8 /* WebCoreNSCellExtras.h in Headers */, > 1482E0C7156C36DE00965065 /* FractionalLayoutBoxExtent.h in Headers */, >+ 71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >@@ -27951,6 +27958,7 @@ > 371941961566B37200A276D8 /* WebCoreNSCellExtras.m in Sources */, > 146CC115156988E400109E37 /* LengthBox.cpp in Sources */, > 1482E0C6156C36DE00965065 /* FractionalLayoutBoxExtent.cpp in Sources */, >+ 71DCB7011568197600862271 /* JSSVGZoomAndPan.cpp in Sources */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 15f5d941d5743675bf393e1c523419bcaff16ca0..3a752ff1974a6a16efe9caaef0646dafb9a536e0 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -606,6 +606,22 @@ my %usesToJSNewlyCreated = ( > "TouchList" => 1 > ); > >+sub ShouldGenerateToJSDeclaration >+{ >+ my ($hasParent, $dataNode) = @_; >+ return 0 if ($dataNode->extendedAttributes->{"SuppressToJSObject"}); >+ return 1 if (!$hasParent or $dataNode->extendedAttributes->{"JSGenerateToJSObject"} or ($dataNode->extendedAttributes->{"CustomToJSObject"} or $dataNode->extendedAttributes->{"JSCustomToJSObject"})); >+ return 0; >+} >+ >+sub ShouldGenerateToJSImplementation >+{ >+ my ($hasParent, $dataNode) = @_; >+ return 0 if ($dataNode->extendedAttributes->{"SuppressToJSObject"}); >+ return 1 if ((!$hasParent or $dataNode->extendedAttributes->{"JSGenerateToJSObject"}) and !($dataNode->extendedAttributes->{"CustomToJSObject"} or $dataNode->extendedAttributes->{"JSCustomToJSObject"})); >+ return 0; >+} >+ > sub GetFunctionName > { > my ($className, $function) = @_; >@@ -994,8 +1010,7 @@ sub GenerateHeader > push(@headerContent, "}\n"); > push(@headerContent, "\n"); > } >- >- if (!$hasParent || $dataNode->extendedAttributes->{"JSGenerateToJSObject"} || ($dataNode->extendedAttributes->{"CustomToJSObject"} || $dataNode->extendedAttributes->{"JSCustomToJSObject"})) { >+ if (ShouldGenerateToJSDeclaration($hasParent, $dataNode)) { > push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n"); > } > if (!$hasParent || $dataNode->extendedAttributes->{"JSGenerateToNativeObject"}) { >@@ -2340,7 +2355,7 @@ sub GenerateImplementation > push(@implContent, "}\n\n"); > } > >- if ((!$hasParent or $dataNode->extendedAttributes->{"JSGenerateToJSObject"}) and !($dataNode->extendedAttributes->{"CustomToJSObject"} or $dataNode->extendedAttributes->{"JSCustomToJSObject"})) { >+ if (ShouldGenerateToJSImplementation($hasParent, $dataNode)) { > push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* impl)\n"); > push(@implContent, "{\n"); > if ($svgPropertyType) { >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >index ad15e606f2999472af2e42b324f41c26a188d7a7..7789308165958871a8f97b71c987947ac37237a2 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >@@ -447,7 +447,7 @@ END > } > END > >- if ($interfaceName eq 'Element') { >+ if ($interfaceName eq 'Element') or $dataNode->extendedAttributes->{"SuppressToJSObject"}) { > # Do not generate toV8() for performance optimization. > } elsif (!($dataNode->extendedAttributes->{"CustomToJSObject"} or $dataNode->extendedAttributes->{"V8CustomToJSObject"})) { > push(@headerContent, <<END); >diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.txt b/Source/WebCore/bindings/scripts/IDLAttributes.txt >index 848949327b8023bd0f1dbf3b903beb027c9c511f..57f50a5acd24c94d85b9e655c52393ef3a0b2fa6 100644 >--- a/Source/WebCore/bindings/scripts/IDLAttributes.txt >+++ b/Source/WebCore/bindings/scripts/IDLAttributes.txt >@@ -98,6 +98,7 @@ ReplaceableConstructor > ReturnNewObject > StrictTypeChecking > Supplemental=* >+SuppressToJSObject > TransferList=* > TreatNullAs=NullString > TreatReturnedNullStringAs=False|Null|Undefined >diff --git a/Source/WebCore/gyp/WebCore.gyp b/Source/WebCore/gyp/WebCore.gyp >index 61fb3ccf7e9618869b1d4e2b9cd687966b36c9e6..c0d4a7c8d7fc1e725aea73b9aa3efb0d0b0d00bf 100644 >--- a/Source/WebCore/gyp/WebCore.gyp >+++ b/Source/WebCore/gyp/WebCore.gyp >@@ -123,7 +123,6 @@ > ['exclude', 'JSSVGTests\\.(cpp|h)'], > ['exclude', 'JSSVGTransformable\\.(cpp|h)'], > ['exclude', 'JSSVGURIReference\\.(cpp|h)'], >- ['exclude', 'JSSVGZoomAndPan\\.(cpp|h)'], > ['exclude', 'tokenizer\\.cpp'], > > ['exclude', 'AllInOne\\.cpp$'], >diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl >index 597d07d941a7ae150a2c158b458a35e32a1eadfe..94ced01c5a99b28655e1f04cef8cafd8173497e1 100644 >--- a/Source/WebCore/page/DOMWindow.idl >+++ b/Source/WebCore/page/DOMWindow.idl >@@ -709,6 +709,7 @@ module window { > attribute SVGUseElementConstructor SVGUseElement; > attribute SVGViewElementConstructor SVGViewElement; > // attribute SVGViewSpecConstructor SVGViewSpec; >+ attribute SVGZoomAndPanConstructor SVGZoomAndPan; > > attribute SVGAnimateColorElementConstructor SVGAnimateColorElement; > attribute SVGAnimateElementConstructor SVGAnimateElement; >diff --git a/Source/WebCore/svg/SVGDocument.cpp b/Source/WebCore/svg/SVGDocument.cpp >index c29ede36921bd2ce75955c47d937fdeb7443233f..ff774d2ea988dfdf309fc463b0b8386087b8fc36 100644 >--- a/Source/WebCore/svg/SVGDocument.cpp >+++ b/Source/WebCore/svg/SVGDocument.cpp >@@ -73,9 +73,9 @@ bool SVGDocument::zoomAndPanEnabled() const > if (rootElement()) { > if (rootElement()->useCurrentView()) { > if (rootElement()->currentView()) >- return rootElement()->currentView()->zoomAndPan() == SVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY; >+ return rootElement()->currentView()->zoomAndPan() == SVGZoomAndPanMagnify; > } else >- return rootElement()->zoomAndPan() == SVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY; >+ return rootElement()->zoomAndPan() == SVGZoomAndPanMagnify; > } > > return false; >diff --git a/Source/WebCore/svg/SVGExternalResourcesRequired.idl b/Source/WebCore/svg/SVGExternalResourcesRequired.idl >index ef0d720760cf459ae1499649be910c5ae378dacc..a650c8f8da364cfc90f2db0220e3553f56a857bb 100644 >--- a/Source/WebCore/svg/SVGExternalResourcesRequired.idl >+++ b/Source/WebCore/svg/SVGExternalResourcesRequired.idl >@@ -29,6 +29,7 @@ module svg { > interface [ > Conditional=SVG, > ObjCProtocol, >+ SuppressToJSObject, > OmitConstructor > ] SVGExternalResourcesRequired { > readonly attribute SVGAnimatedBoolean externalResourcesRequired; >diff --git a/Source/WebCore/svg/SVGFitToViewBox.idl b/Source/WebCore/svg/SVGFitToViewBox.idl >index 1ed3227f7c0ccc13bd5f3ea7312b05c75a6545ff..a57a8ddf1d8248a4487edd50e9cc09b75d8e2ffb 100644 >--- a/Source/WebCore/svg/SVGFitToViewBox.idl >+++ b/Source/WebCore/svg/SVGFitToViewBox.idl >@@ -29,6 +29,7 @@ module svg { > interface [ > Conditional=SVG, > ObjCProtocol, >+ SuppressToJSObject, > OmitConstructor > ] SVGFitToViewBox { > readonly attribute SVGAnimatedRect viewBox; >diff --git a/Source/WebCore/svg/SVGLangSpace.idl b/Source/WebCore/svg/SVGLangSpace.idl >index d3a26747d580c96c17a6b0d304f62523f3d54cbe..212c85a81fc65bfeaeaeb33fcb3910528474d655 100644 >--- a/Source/WebCore/svg/SVGLangSpace.idl >+++ b/Source/WebCore/svg/SVGLangSpace.idl >@@ -29,6 +29,7 @@ module svg { > interface [ > Conditional=SVG, > ObjCProtocol, >+ SuppressToJSObject, > OmitConstructor > ] SVGLangSpace { > attribute DOMString xmllang >diff --git a/Source/WebCore/svg/SVGLocatable.idl b/Source/WebCore/svg/SVGLocatable.idl >index f626976ddd97606f6c9c2317886619978444fe66..3b38a39f19d9c900b06d0121e8ca96c18ace7680 100644 >--- a/Source/WebCore/svg/SVGLocatable.idl >+++ b/Source/WebCore/svg/SVGLocatable.idl >@@ -29,6 +29,7 @@ module svg { > interface [ > Conditional=SVG, > ObjCProtocol, >+ SuppressToJSObject, > OmitConstructor > ] SVGLocatable { > readonly attribute SVGElement nearestViewportElement; >diff --git a/Source/WebCore/svg/SVGRenderingIntent.idl b/Source/WebCore/svg/SVGRenderingIntent.idl >index a5f71f324c3d0811f09c940148a4d5bb9c962135..c66d648c6d6e4b903802d94fb029978beff22548 100644 >--- a/Source/WebCore/svg/SVGRenderingIntent.idl >+++ b/Source/WebCore/svg/SVGRenderingIntent.idl >@@ -26,7 +26,8 @@ > module svg { > > interface [ >- Conditional=SVG >+ Conditional=SVG, >+ SuppressToJSObject > ] SVGRenderingIntent { > // Rendering Intent Types > const unsigned short RENDERING_INTENT_UNKNOWN = 0; >diff --git a/Source/WebCore/svg/SVGSVGElement.cpp b/Source/WebCore/svg/SVGSVGElement.cpp >index 8e0f210ff731c98882ef07c6aeb3cb4b20fdd84a..7f1b6c7fc8c2588d67537825f608130dea594756 100644 >--- a/Source/WebCore/svg/SVGSVGElement.cpp >+++ b/Source/WebCore/svg/SVGSVGElement.cpp >@@ -52,6 +52,7 @@ > #include "SVGTransformList.h" > #include "SVGViewElement.h" > #include "SVGViewSpec.h" >+#include "SVGZoomAndPan.h" > #include "SVGZoomEvent.h" > #include "ScriptEventListener.h" > #include "StaticNodeList.h" >@@ -87,6 +88,7 @@ inline SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc) > , m_width(LengthModeWidth, "100%") > , m_height(LengthModeHeight, "100%") > , m_useCurrentView(false) >+ , m_zoomAndPan(SVGZoomAndPanMagnify) > , m_timeContainer(SMILTimeContainer::create(this)) > { > ASSERT(hasTagName(SVGNames::svgTag)); >@@ -168,16 +170,6 @@ float SVGSVGElement::screenPixelToMillimeterY() const > return pixelUnitToMillimeterY(); > } > >-bool SVGSVGElement::useCurrentView() const >-{ >- return m_useCurrentView; >-} >- >-void SVGSVGElement::setUseCurrentView(bool currentView) >-{ >- m_useCurrentView = currentView; >-} >- > SVGViewSpec* SVGSVGElement::currentView() const > { > if (!m_viewSpec) >@@ -278,7 +270,7 @@ void SVGSVGElement::parseAttribute(const Attribute& attribute) > || SVGLangSpace::parseAttribute(attribute) > || SVGExternalResourcesRequired::parseAttribute(attribute) > || SVGFitToViewBox::parseAttribute(document(), attribute) >- || SVGZoomAndPan::parseAttribute(attribute)) { >+ || SVGZoomAndPan::parseAttribute(this, attribute)) { > } else > SVGStyledLocatableElement::parseAttribute(attribute); > >@@ -657,7 +649,7 @@ AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie > AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight); > if (useCurrentView() && currentView()) { > AffineTransform transform; >- if (currentView()->transform().concatenate(transform)) >+ if (currentView()->transformBaseValue().concatenate(transform)) > ctm *= transform; > } > >@@ -688,7 +680,7 @@ void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* > if (!m_useCurrentView) > return; > } else if (!m_useCurrentView) >- currentView()->setTransform(emptyString()); >+ currentView()->setTransformString(emptyString()); > > // Force a layout, otherwise RenderSVGRoots localToBorderBoxTransform won't be rebuild. > if (RenderObject* object = renderer()) >@@ -713,7 +705,7 @@ void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) > currentView()->setPreserveAspectRatioBaseValue(aspectRatio); > > if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr)) >- currentView()->setZoomAndPan(viewElement->zoomAndPan()); >+ currentView()->setZoomAndPanBaseValue(viewElement->zoomAndPan()); > > if (RenderObject* object = renderer()) > RenderSVGResource::markForLayoutAndParentResourceInvalidation(object); >diff --git a/Source/WebCore/svg/SVGSVGElement.h b/Source/WebCore/svg/SVGSVGElement.h >index 6ead78bd2840d5898619665f8d2ca22b1c8c7c43..1fae77dcd1e85c6c4a67f75a7c6c05bab5109b27 100644 >--- a/Source/WebCore/svg/SVGSVGElement.h >+++ b/Source/WebCore/svg/SVGSVGElement.h >@@ -51,6 +51,9 @@ class SVGSVGElement : public SVGStyledLocatableElement, > public: > static PassRefPtr<SVGSVGElement> create(const QualifiedName&, Document*); > >+ using SVGStyledLocatableElement::ref; >+ using SVGStyledLocatableElement::deref; >+ > virtual bool isValid() const { return SVGTests::isValid(); } > virtual bool supportsFocus() const { return true; } > >@@ -68,8 +71,8 @@ public: > float screenPixelToMillimeterX() const; > float screenPixelToMillimeterY() const; > >- bool useCurrentView() const; >- void setUseCurrentView(bool currentView); >+ bool useCurrentView() const { return m_useCurrentView; } >+ void setUseCurrentView(bool currentView) { m_useCurrentView = currentView; } > > SVGViewSpec* currentView() const; > >@@ -131,6 +134,9 @@ public: > bool widthAttributeEstablishesViewport() const; > bool heightAttributeEstablishesViewport() const; > >+ SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } >+ void setZoomAndPan(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); } >+ > protected: > virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE; > >@@ -182,6 +188,7 @@ private: > virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const; > > bool m_useCurrentView; >+ SVGZoomAndPanType m_zoomAndPan; > RefPtr<SMILTimeContainer> m_timeContainer; > FloatPoint m_translation; > mutable OwnPtr<SVGViewSpec> m_viewSpec; >diff --git a/Source/WebCore/svg/SVGStylable.idl b/Source/WebCore/svg/SVGStylable.idl >index 3e06563f042ecad624aaa2ff859cf8a097493657..53269c98ea88b280d55db4eaca39f190fa8db98a 100644 >--- a/Source/WebCore/svg/SVGStylable.idl >+++ b/Source/WebCore/svg/SVGStylable.idl >@@ -30,6 +30,7 @@ module svg { > interface [ > Conditional=SVG, > ObjCProtocol, >+ SuppressToJSObject, > OmitConstructor > ] SVGStylable { > readonly attribute SVGAnimatedString className; >diff --git a/Source/WebCore/svg/SVGTests.idl b/Source/WebCore/svg/SVGTests.idl >index 11d9856a669f4b8a67027be06f4ca23285d734c0..d9f79ccbf2a9c7f85f6e5c5b683583e8c35b50b4 100644 >--- a/Source/WebCore/svg/SVGTests.idl >+++ b/Source/WebCore/svg/SVGTests.idl >@@ -29,6 +29,7 @@ module svg { > interface [ > Conditional=SVG, > ObjCProtocol, >+ SuppressToJSObject, > OmitConstructor > ] SVGTests { > readonly attribute SVGStringList requiredFeatures; >diff --git a/Source/WebCore/svg/SVGURIReference.idl b/Source/WebCore/svg/SVGURIReference.idl >index 56e3185b6da42a447b54011748238635d5ae6bc9..960873e9cd60aa6976f713f8758fe88c75af7fc3 100644 >--- a/Source/WebCore/svg/SVGURIReference.idl >+++ b/Source/WebCore/svg/SVGURIReference.idl >@@ -29,6 +29,7 @@ module svg { > interface [ > Conditional=SVG, > ObjCProtocol, >+ SuppressToJSObject, > OmitConstructor > ] SVGURIReference { > readonly attribute SVGAnimatedString href; >diff --git a/Source/WebCore/svg/SVGUnitTypes.idl b/Source/WebCore/svg/SVGUnitTypes.idl >index ef5d642da46f563fd2abdaee2d9b9837a243920c..7ed8b0ba6aa17ce1a853172aeaebdc23c8525fbb 100644 >--- a/Source/WebCore/svg/SVGUnitTypes.idl >+++ b/Source/WebCore/svg/SVGUnitTypes.idl >@@ -26,7 +26,8 @@ > module svg { > > interface [ >- Conditional=SVG >+ Conditional=SVG, >+ SuppressToJSObject > ] SVGUnitTypes { > // Unit Types > const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0; >diff --git a/Source/WebCore/svg/SVGViewElement.cpp b/Source/WebCore/svg/SVGViewElement.cpp >index 2a2fef17137bccef3d804081dbe0d8db873d3f0d..dabe9db5cf3ede9f67116ce216d7521542b0937c 100644 >--- a/Source/WebCore/svg/SVGViewElement.cpp >+++ b/Source/WebCore/svg/SVGViewElement.cpp >@@ -45,6 +45,7 @@ END_REGISTER_ANIMATED_PROPERTIES > > inline SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document* document) > : SVGStyledElement(tagName, document) >+ , m_zoomAndPan(SVGZoomAndPanMagnify) > , m_viewTarget(SVGNames::viewTargetAttr) > { > ASSERT(hasTagName(SVGNames::viewTag)); >@@ -84,7 +85,7 @@ void SVGViewElement::parseAttribute(const Attribute& attribute) > return; > if (SVGFitToViewBox::parseAttribute(document(), attribute)) > return; >- if (SVGZoomAndPan::parseAttribute(attribute)) >+ if (SVGZoomAndPan::parseAttribute(this, attribute)) > return; > > ASSERT_NOT_REACHED(); >diff --git a/Source/WebCore/svg/SVGViewElement.h b/Source/WebCore/svg/SVGViewElement.h >index 6d8089ea2efa8b7c828e9a6d2d02ff8db9f1c681..11f58388a7e05da1ca4077e3b4017b86026761ff 100644 >--- a/Source/WebCore/svg/SVGViewElement.h >+++ b/Source/WebCore/svg/SVGViewElement.h >@@ -40,8 +40,14 @@ class SVGViewElement : public SVGStyledElement, > public: > static PassRefPtr<SVGViewElement> create(const QualifiedName&, Document*); > >+ using SVGStyledElement::ref; >+ using SVGStyledElement::deref; >+ > SVGStringList& viewTarget() { return m_viewTarget; } > >+ SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } >+ void setZoomAndPan(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); } >+ > private: > SVGViewElement(const QualifiedName&, Document*); > >@@ -57,6 +63,7 @@ private: > DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio) > END_DECLARE_ANIMATED_PROPERTIES > >+ SVGZoomAndPanType m_zoomAndPan; > SVGStringList m_viewTarget; > }; > >diff --git a/Source/WebCore/svg/SVGViewSpec.cpp b/Source/WebCore/svg/SVGViewSpec.cpp >index 415b19e5b99d50ce665d89e496cbdcae3c728ae2..8bb040055d7c0a02f3a6a3edf8232a723709b9fe 100644 >--- a/Source/WebCore/svg/SVGViewSpec.cpp >+++ b/Source/WebCore/svg/SVGViewSpec.cpp >@@ -41,12 +41,13 @@ END_REGISTER_ANIMATED_PROPERTIES > > SVGViewSpec::SVGViewSpec(SVGElement* contextElement) > : m_contextElement(contextElement) >+ , m_zoomAndPan(SVGZoomAndPanMagnify) > { > ASSERT(m_contextElement); > registerAnimatedPropertiesForSVGViewSpec(); > } > >-void SVGViewSpec::setTransform(const String& transform) >+void SVGViewSpec::setTransformString(const String& transform) > { > m_transform.parse(transform); > } >@@ -131,7 +132,7 @@ bool SVGViewSpec::parseViewSpec(const String& viewSpec) > if (currViewSpec >= end || *currViewSpec != '(') > return false; > currViewSpec++; >- if (!parseZoomAndPan(currViewSpec, end)) >+ if (!parseZoomAndPan(currViewSpec, end, m_zoomAndPan)) > return false; > if (currViewSpec >= end || *currViewSpec != ')') > return false; >diff --git a/Source/WebCore/svg/SVGViewSpec.h b/Source/WebCore/svg/SVGViewSpec.h >index c21a0c959058028f48dc1859e06ee52961d3418b..1e4c2715844f6b99d1a7ab691a7dba49c64ef736 100644 >--- a/Source/WebCore/svg/SVGViewSpec.h >+++ b/Source/WebCore/svg/SVGViewSpec.h >@@ -31,16 +31,17 @@ namespace WebCore { > > class SVGElement; > >-class SVGViewSpec : public SVGFitToViewBox, >- public SVGZoomAndPan { >+class SVGViewSpec : public SVGZoomAndPan, >+ public SVGFitToViewBox { > WTF_MAKE_NONCOPYABLE(SVGViewSpec); > public: > SVGViewSpec(SVGElement*); > > bool parseViewSpec(const String&); > >- void setTransform(const String&); >+ void setTransformString(const String&); > SVGTransformList transform() const { return m_transform; } >+ SVGTransformList transformBaseValue() const { return m_transform; } > > void setViewBoxString(const String&); > >@@ -50,6 +51,10 @@ public: > String viewTargetString() const { return m_viewTargetString; } > SVGElement* viewTarget() const; > >+ SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } >+ void setZoomAndPan(unsigned short, ExceptionCode&); >+ void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); } >+ > private: > SVGElement* m_contextElement; > >@@ -60,6 +65,7 @@ private: > > SVGTransformList m_transform; > String m_viewTargetString; >+ SVGZoomAndPanType m_zoomAndPan; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGZoomAndPan.cpp b/Source/WebCore/svg/SVGZoomAndPan.cpp >index e706affda3013ec48a361eefd11741cbccf58ee4..813ebe76a5e2be99d7607cc5e6e42b7c4d9d4196 100644 >--- a/Source/WebCore/svg/SVGZoomAndPan.cpp >+++ b/Source/WebCore/svg/SVGZoomAndPan.cpp >@@ -23,52 +23,49 @@ > #if ENABLE(SVG) > #include "SVGZoomAndPan.h" > >-#include "Attribute.h" >-#include "SVGNames.h" > #include "SVGParserUtilities.h" > > namespace WebCore { > >-void SVGZoomAndPan::setZoomAndPan(unsigned short zoomAndPan) >+bool SVGZoomAndPan::isKnownAttribute(const QualifiedName& attrName) > { >- m_zoomAndPan = zoomAndPan; >+ return attrName == SVGNames::zoomAndPanAttr; > } > >-bool SVGZoomAndPan::parseAttribute(const Attribute& attribute) >+void SVGZoomAndPan::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes) > { >- if (attribute.name() == SVGNames::zoomAndPanAttr) { >- const UChar* start = attribute.value().characters(); >- const UChar* end = start + attribute.value().length(); >- parseZoomAndPan(start, end); >+ supportedAttributes.add(SVGNames::zoomAndPanAttr); >+} >+ >+static const UChar disable[] = {'d', 'i', 's', 'a', 'b', 'l', 'e'}; >+static const UChar magnify[] = {'m', 'a', 'g', 'n', 'i', 'f', 'y'}; >+ >+bool SVGZoomAndPan::parseZoomAndPan(const UChar*& start, const UChar* end, SVGZoomAndPanType& zoomAndPan) >+{ >+ if (skipString(start, end, disable, WTF_ARRAY_LENGTH(disable))) { >+ zoomAndPan = SVGZoomAndPanDisable; >+ return true; >+ } >+ if (skipString(start, end, magnify, WTF_ARRAY_LENGTH(magnify))) { >+ zoomAndPan = SVGZoomAndPanMagnify; > return true; > } >- > return false; > } > >-bool SVGZoomAndPan::isKnownAttribute(const QualifiedName& attrName) >+NO_RETURN_DUE_TO_ASSERT void SVGZoomAndPan::ref() > { >- return attrName == SVGNames::zoomAndPanAttr; >+ ASSERT_NOT_REACHED(); > } > >-void SVGZoomAndPan::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes) >+NO_RETURN_DUE_TO_ASSERT void SVGZoomAndPan::deref() > { >- supportedAttributes.add(SVGNames::zoomAndPanAttr); >+ ASSERT_NOT_REACHED(); > } > >-static const UChar disable[] = {'d', 'i', 's', 'a', 'b', 'l', 'e'}; >-static const UChar magnify[] = {'m', 'a', 'g', 'n', 'i', 'f', 'y'}; >- >-bool SVGZoomAndPan::parseZoomAndPan(const UChar*& start, const UChar* end) >+NO_RETURN_DUE_TO_ASSERT void SVGZoomAndPan::setZoomAndPan(unsigned short) > { >- if (skipString(start, end, disable, WTF_ARRAY_LENGTH(disable))) >- setZoomAndPan(SVG_ZOOMANDPAN_DISABLE); >- else if (skipString(start, end, magnify, WTF_ARRAY_LENGTH(magnify))) >- setZoomAndPan(SVG_ZOOMANDPAN_MAGNIFY); >- else >- return false; >- >- return true; >+ ASSERT_NOT_REACHED(); > } > > } >diff --git a/Source/WebCore/svg/SVGZoomAndPan.h b/Source/WebCore/svg/SVGZoomAndPan.h >index e2d52f64dc3d40ef14cd739a5dcfabefa04b2772..b5147ab8fd58273cd21ecb836af0c2be81476916 100644 >--- a/Source/WebCore/svg/SVGZoomAndPan.h >+++ b/Source/WebCore/svg/SVGZoomAndPan.h >@@ -22,40 +22,69 @@ > #define SVGZoomAndPan_h > > #if ENABLE(SVG) >+#include "Attribute.h" > #include "QualifiedName.h" >+#include "SVGNames.h" > #include <wtf/HashSet.h> >+#include <wtf/RefCounted.h> > #include <wtf/unicode/Unicode.h> > > namespace WebCore { > >-class Attribute; >+enum SVGZoomAndPanType { >+ SVGZoomAndPanUnknown = 0, >+ SVGZoomAndPanDisable, >+ SVGZoomAndPanMagnify >+}; > > class SVGZoomAndPan { > public: >- enum SVGZoomAndPanType { >- SVG_ZOOMANDPAN_UNKNOWN = 0, >- SVG_ZOOMANDPAN_DISABLE = 1, >- SVG_ZOOMANDPAN_MAGNIFY = 2 >+ // Forward declare enumerations in the W3C naming scheme, for IDL generation. >+ enum { >+ SVG_ZOOMANDPAN_UNKNOWN = SVGZoomAndPanUnknown, >+ SVG_ZOOMANDPAN_DISABLE = SVGZoomAndPanDisable, >+ SVG_ZOOMANDPAN_MAGNIFY = SVGZoomAndPanMagnify > }; > >- SVGZoomAndPan() : m_zoomAndPan(SVG_ZOOMANDPAN_MAGNIFY) { } >- virtual ~SVGZoomAndPan() { } >+ static bool isKnownAttribute(const QualifiedName&); >+ static void addSupportedAttributes(HashSet<QualifiedName>&); >+ >+ static SVGZoomAndPanType parseFromNumber(unsigned short number) >+ { >+ if (!number || number > SVGZoomAndPanMagnify) >+ return SVGZoomAndPanUnknown; >+ return static_cast<SVGZoomAndPanType>(number); >+ } > >- unsigned short zoomAndPan() const { return m_zoomAndPan; } >- virtual void setZoomAndPan(unsigned short zoomAndPan); >+ static bool parseZoomAndPan(const UChar*& start, const UChar* end, SVGZoomAndPanType&); > >- bool parseAttribute(const Attribute&); >- bool isKnownAttribute(const QualifiedName&); >- void addSupportedAttributes(HashSet<QualifiedName>&); >+ template<class SVGElementTarget> >+ static bool parseAttribute(SVGElementTarget* target, const Attribute& attribute) >+ { >+ ASSERT(target); >+ ASSERT(target->document()); >+ if (attribute.name() == SVGNames::zoomAndPanAttr) { >+ const UChar* start = attribute.value().characters(); >+ const UChar* end = start + attribute.value().length(); >+ SVGZoomAndPanType zoomAndPan = SVGZoomAndPanUnknown; >+ parseZoomAndPan(start, end, zoomAndPan); >+ target->setZoomAndPan(zoomAndPan); >+ return true; >+ } > >- bool parseZoomAndPan(const UChar*& start, const UChar* end); >+ return false; >+ } > >-private: >- unsigned short m_zoomAndPan; >+ SVGZoomAndPanType zoomAndPan() const { return SVGZoomAndPanUnknown; } >+ >+ // These methods only exist to allow us to compile V8/JSSVGZoomAndPan.*. >+ // These are never called, and thus ASSERT_NOT_REACHED. >+ void ref(); >+ void deref(); >+ void setZoomAndPan(unsigned short); > }; > > } // namespace WebCore > > #endif // ENABLE(SVG) >- > #endif // SVGZoomAndPan_h >diff --git a/Source/WebCore/svg/SVGZoomAndPan.idl b/Source/WebCore/svg/SVGZoomAndPan.idl >index d60ae0ced206a645b5a537ba6e92e55651b7e9a9..37621bb8cb6b26e4a37fa90b2745ab766fc746dd 100644 >--- a/Source/WebCore/svg/SVGZoomAndPan.idl >+++ b/Source/WebCore/svg/SVGZoomAndPan.idl >@@ -28,15 +28,14 @@ module svg { > > interface [ > Conditional=SVG, >- ObjCProtocol >+ ObjCProtocol, >+ SuppressToJSObject > ] SVGZoomAndPan { >- // Zoom and Pan Types > const unsigned short SVG_ZOOMANDPAN_UNKNOWN = 0; > const unsigned short SVG_ZOOMANDPAN_DISABLE = 1; > const unsigned short SVG_ZOOMANDPAN_MAGNIFY = 2; > >- attribute unsigned short zoomAndPan >- /*setter raises(DOMException)*/; >+ attribute unsigned short zoomAndPan; > }; > > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6846e225a0b1a8ca2424ee23ba2331bd0693234a..12e16be488f2add50d2c901de5f4f1ac49f8ce7e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2012-05-23 Nikolas Zimmermann <nzimmermann@rim.com> >+ >+ SVGZoomAndPan constants are missing from window object >+ https://bugs.webkit.org/show_bug.cgi?id=15494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ SVGZoomAndPan is now available as global constructor, rebaseline results. >+ >+ * svg/custom/global-constructors-expected.txt: >+ * svg/custom/js-svg-constructors-expected.txt: >+ * svg/custom/js-svg-constructors.svg: >+ > 2012-05-23 Christophe Dumez <christophe.dumez@intel.com> > > [EFL] EFL's DRT needs to call Settings::setValidationMessageTimerMagnification(-1) >diff --git a/LayoutTests/svg/custom/global-constructors-expected.txt b/LayoutTests/svg/custom/global-constructors-expected.txt >index b0bfc681351ea8f79e38a80774306bb09f35154c..72deff592840eaae7c6ba09240b2a4ed9a1253b4 100644 >--- a/LayoutTests/svg/custom/global-constructors-expected.txt >+++ b/LayoutTests/svg/custom/global-constructors-expected.txt >@@ -31,7 +31,7 @@ FAIL SVGTests.toString() should be [object SVGTestsConstructor]. Threw exception > FAIL SVGLangSpace.toString() should be [object SVGLangSpaceConstructor]. Threw exception ReferenceError: Can't find variable: SVGLangSpace > FAIL SVGExternalResourcesRequired.toString() should be [object SVGExternalResourcesRequiredConstructor]. Threw exception ReferenceError: Can't find variable: SVGExternalResourcesRequired > FAIL SVGFitToViewBox.toString() should be [object SVGFitToViewBoxConstructor]. Threw exception ReferenceError: Can't find variable: SVGFitToViewBox >-FAIL SVGZoomAndPan.toString() should be [object SVGZoomAndPanConstructor]. Threw exception ReferenceError: Can't find variable: SVGZoomAndPan >+PASS SVGZoomAndPan.toString() is '[object SVGZoomAndPanConstructor]' > FAIL SVGViewSpec.toString() should be [object SVGViewSpecConstructor]. Threw exception ReferenceError: Can't find variable: SVGViewSpec > FAIL SVGURIReference.toString() should be [object SVGURIReferenceConstructor]. Threw exception ReferenceError: Can't find variable: SVGURIReference > FAIL SVGCSSRule.toString() should be [object SVGCSSRuleConstructor]. Threw exception ReferenceError: Can't find variable: SVGCSSRule >diff --git a/LayoutTests/svg/custom/js-svg-constructors-expected.txt b/LayoutTests/svg/custom/js-svg-constructors-expected.txt >index ab7e638eb0d07b0652ec595166c0520d45fd66d6..1b72283ecf1f3b7b758f1416f12274edf3790615 100644 >--- a/LayoutTests/svg/custom/js-svg-constructors-expected.txt >+++ b/LayoutTests/svg/custom/js-svg-constructors-expected.txt >@@ -44,9 +44,9 @@ SVGFEDisplacementMapElement.SVG_CHANNEL_R PASSED > SVGFEDisplacementMapElement.SVG_CHANNEL_G PASSED > SVGFEDisplacementMapElement.SVG_CHANNEL_B PASSED > SVGFEDisplacementMapElement.SVG_CHANNEL_A PASSED >-SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_UNKNOWN EXPECTED FAILURE (actual: '0' expected: '0') >-SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_ERODE EXPECTED FAILURE (actual: '1' expected: '1') >-SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_DILATE EXPECTED FAILURE (actual: '2' expected: '2') >+SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_UNKNOWN PASSED >+SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_ERODE PASSED >+SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_DILATE PASSED > SVGFETurbulenceElement.SVG_TURBULENCE_TYPE_UNKNOWN PASSED > SVGFETurbulenceElement.SVG_TURBULENCE_TYPE_FRACTALNOISE PASSED > SVGFETurbulenceElement.SVG_TURBULENCE_TYPE_TURBULENCE PASSED >@@ -143,6 +143,6 @@ SVGTransform.SVG_TRANSFORM_SKEWY PASSED > SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN PASSED > SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE PASSED > SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX PASSED >-SVGZoomAndPan.SVG_ZOOMANDPAN_UNKNOWN EXPECTED FAILURE (actual: 'undefined' expected: '0') >-SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE EXPECTED FAILURE (actual: 'undefined' expected: '1') >-SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY EXPECTED FAILURE (actual: 'undefined' expected: '2') >+SVGZoomAndPan.SVG_ZOOMANDPAN_UNKNOWN PASSED >+SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE PASSED >+SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY PASSED >diff --git a/LayoutTests/svg/custom/js-svg-constructors.svg b/LayoutTests/svg/custom/js-svg-constructors.svg >index 35631cdcea079c6e6a150241c32ee033c50c2fc1..85871371bac097484a7a7e13e6f9b58f25e0bb7c 100644 >--- a/LayoutTests/svg/custom/js-svg-constructors.svg >+++ b/LayoutTests/svg/custom/js-svg-constructors.svg >@@ -93,9 +93,9 @@ > } > > if (window.SVGFEMorphologyElement) { >- expect_failure("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_UNKNOWN", 0); >- expect_failure("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_ERODE", 1); >- expect_failure("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_DILATE", 2); >+ expect("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_UNKNOWN", 0); >+ expect("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_ERODE", 1); >+ expect("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_DILATE", 2); > } > > if (window.SVGFETurbulenceElement) { >@@ -208,9 +208,9 @@ > expect("SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE", 1); > expect("SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", 2); > >- expect_failure("SVGZoomAndPan.SVG_ZOOMANDPAN_UNKNOWN", 0); >- expect_failure("SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE", 1); >- expect_failure("SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY", 2); >+ expect("SVGZoomAndPan.SVG_ZOOMANDPAN_UNKNOWN", 0); >+ expect("SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE", 1); >+ expect("SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY", 2); > } > ]]></script> > </svg>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 15494
:
142874
|
142883
|
143244
|
143301
|
143311
|
143488
|
143499