Changeset 73011 in webkit


Ignore:
Timestamp:
Dec 1, 2010 12:57:20 AM (13 years ago)
Author:
Nikolas Zimmermann
Message:

2010-12-01 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Dirk Schulze.

Cleanup SVGPropertyTraits
https://bugs.webkit.org/show_bug.cgi?id=50229

Move all template specializations for non-POD types (eg. SVGLength, SVGLengthList, etc.) from SVGPropertyTraits
into the right SVG* classes, to avoid having to include a dozen SVG*.h files in SVGPropertyTraits.h, which is
included by all DOM/JS/V8 binding files and SVGElement.h.

No new functionality, thus no new tests.

  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/scripts/CodeGenerator.pm:
  • bindings/scripts/CodeGeneratorObjC.pm:
  • bindings/scripts/CodeGeneratorV8.pm:
  • svg/SVGAngle.h:
  • svg/SVGLength.h:
  • svg/SVGLengthList.h:
  • svg/SVGMarkerElement.h:
  • svg/SVGNumberList.h:
  • svg/SVGPatternElement.h:
  • svg/SVGPointList.h:
  • svg/SVGPreserveAspectRatio.h:
  • svg/SVGRect.h: Added.
  • svg/SVGSVGElement.h:
  • svg/SVGStringList.h:
  • svg/SVGSymbolElement.h:
  • svg/SVGTransformList.h:
  • svg/SVGViewElement.h:
  • svg/SVGViewSpec.h:
  • svg/properties/SVGListProperty.h:
  • svg/properties/SVGPropertyTraits.h:
  • svg/properties/SVGTransformListPropertyTearOff.h:
Location:
trunk/WebCore
Files:
1 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73008 r73011  
     12010-12-01  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Cleanup SVGPropertyTraits
     6        https://bugs.webkit.org/show_bug.cgi?id=50229
     7
     8        Move all template specializations for non-POD types (eg. SVGLength, SVGLengthList, etc.) from SVGPropertyTraits
     9        into the right SVG* classes, to avoid having to include a dozen SVG*.h files in SVGPropertyTraits.h, which is
     10        included by all DOM/JS/V8 binding files and SVGElement.h.
     11
     12        No new functionality, thus no new tests.
     13
     14        * GNUmakefile.am:
     15        * WebCore.gypi:
     16        * WebCore.pro:
     17        * WebCore.xcodeproj/project.pbxproj:
     18        * bindings/scripts/CodeGenerator.pm:
     19        * bindings/scripts/CodeGeneratorObjC.pm:
     20        * bindings/scripts/CodeGeneratorV8.pm:
     21        * svg/SVGAngle.h:
     22        * svg/SVGLength.h:
     23        * svg/SVGLengthList.h:
     24        * svg/SVGMarkerElement.h:
     25        * svg/SVGNumberList.h:
     26        * svg/SVGPatternElement.h:
     27        * svg/SVGPointList.h:
     28        * svg/SVGPreserveAspectRatio.h:
     29        * svg/SVGRect.h: Added.
     30        * svg/SVGSVGElement.h:
     31        * svg/SVGStringList.h:
     32        * svg/SVGSymbolElement.h:
     33        * svg/SVGTransformList.h:
     34        * svg/SVGViewElement.h:
     35        * svg/SVGViewSpec.h:
     36        * svg/properties/SVGListProperty.h:
     37        * svg/properties/SVGPropertyTraits.h:
     38        * svg/properties/SVGTransformListPropertyTearOff.h:
     39
    1402010-11-30  Kent Tamura  <tkent@chromium.org>
    241
  • trunk/WebCore/GNUmakefile.am

    r72887 r73011  
    33593359        WebCore/svg/SVGRadialGradientElement.cpp \
    33603360        WebCore/svg/SVGRadialGradientElement.h \
     3361        WebCore/svg/SVGRect.h \
    33613362        WebCore/svg/SVGRectElement.cpp \
    33623363        WebCore/svg/SVGRectElement.h \
  • trunk/WebCore/WebCore.gypi

    r72887 r73011  
    42524252            'svg/SVGRadialGradientElement.cpp',
    42534253            'svg/SVGRadialGradientElement.h',
     4254            'svg/SVGRect.h',
    42544255            'svg/SVGRectElement.cpp',
    42554256            'svg/SVGRectElement.h',
  • trunk/WebCore/WebCore.pro

    r72948 r73011  
    25142514    svg/SVGPreserveAspectRatio.h \
    25152515    svg/SVGRadialGradientElement.h \
     2516    svg/SVGRect.h \
    25162517    svg/SVGRectElement.h \
    25172518    svg/SVGScriptElement.h \
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r72887 r73011  
    258258                08E6E0F10EFF42BA00029FBF /* WMLFieldSetElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08E6E0EF0EFF42BA00029FBF /* WMLFieldSetElement.cpp */; };
    259259                08E6E0F20EFF42BA00029FBF /* WMLFieldSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */; };
     260                08EDE19F12A50B8E00B95797 /* SVGRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08EDE19E12A50B8E00B95797 /* SVGRect.h */; };
    260261                08F0BFC21255C53C00075185 /* SVGTextChunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08F0BFBD1255C53C00075185 /* SVGTextChunk.cpp */; };
    261262                08F0BFC31255C53C00075185 /* SVGTextChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F0BFBE1255C53C00075185 /* SVGTextChunk.h */; };
     
    63126313                08E6E0EF0EFF42BA00029FBF /* WMLFieldSetElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFieldSetElement.cpp; sourceTree = "<group>"; };
    63136314                08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFieldSetElement.h; sourceTree = "<group>"; };
     6315                08EDE19E12A50B8E00B95797 /* SVGRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRect.h; sourceTree = "<group>"; };
    63146316                08F0BFBD1255C53C00075185 /* SVGTextChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextChunk.cpp; sourceTree = "<group>"; };
    63156317                08F0BFBE1255C53C00075185 /* SVGTextChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextChunk.h; sourceTree = "<group>"; };
     
    1651316515                                B22279040D00BF210071B782 /* SVGRadialGradientElement.h */,
    1651416516                                B22279050D00BF210071B782 /* SVGRadialGradientElement.idl */,
     16517                                08EDE19E12A50B8E00B95797 /* SVGRect.h */,
    1651516518                                B22279060D00BF210071B782 /* SVGRect.idl */,
    1651616519                                B22279070D00BF210071B782 /* SVGRectElement.cpp */,
     
    2143421437                                2E97CCEB12939CB800C5C8FF /* DataView.h in Headers */,
    2143521438                                2E97CE701293AD6B00C5C8FF /* JSDataView.h in Headers */,
     21439                                08EDE19F12A50B8E00B95797 /* SVGRect.h in Headers */,
    2143621440                        );
    2143721441                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/scripts/CodeGenerator.pm

    r72381 r73011  
    309309    my $type = shift;
    310310
    311     # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h do not exist.
    312     return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber";
     311    # Special case: SVGPoint.h / SVGNumber.h do not exist.
     312    return 1 if $type eq "SVGPoint" or $type eq "SVGNumber";
    313313    return 0;
    314314}
  • trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r72941 r73011  
    13031303                if ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $implClassName =~ /List$/) {
    13041304                    my $idlTypeWithNamespace = GetSVGTypeWithNamespace($type);
     1305                    $implIncludes{"$type.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($type);
    13051306                    if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) {
    13061307                        $idlTypeWithNamespace =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassNameWithNamespace, /;
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r72948 r73011  
    29052905    }
    29062906
    2907     if ($type eq "SVGRect") {
    2908         $implIncludes{"FloatRect.h"} = 1;
    2909     }
    2910 
    29112907    if ($type eq "MediaQueryListListener") {
    29122908        $implIncludes{"MediaQueryListListener.h"} = 1;
  • trunk/WebCore/svg/SVGAngle.h

    r70410 r73011  
    2525#if ENABLE(SVG)
    2626#include "ExceptionCode.h"
    27 #include <wtf/text/WTFString.h>
     27#include "SVGPropertyTraits.h"
    2828
    2929namespace WebCore {
     
    6060};
    6161
     62template<>
     63struct SVGPropertyTraits<SVGAngle> {
     64    static SVGAngle initialValue() { return SVGAngle(); }
     65    static String toString(const SVGAngle& type) { return type.valueAsString(); }
     66};
     67
    6268} // namespace WebCore
    6369
  • trunk/WebCore/svg/SVGLength.h

    r71014 r73011  
    2424#if ENABLE(SVG)
    2525#include "ExceptionCode.h"
    26 #include <wtf/text/WTFString.h>
     26#include "SVGPropertyTraits.h"
    2727
    2828namespace WebCore {
     
    119119};
    120120
     121template<>
     122struct SVGPropertyTraits<SVGLength> {
     123    static SVGLength initialValue() { return SVGLength(); }
     124    static String toString(const SVGLength& type) { return type.valueAsString(); }
     125};
     126
     127
    121128} // namespace WebCore
    122129
  • trunk/WebCore/svg/SVGLengthList.h

    r70223 r73011  
    3636};
    3737
     38template<>
     39struct SVGPropertyTraits<SVGLengthList> {
     40    typedef SVGLength ListItemType;
     41
     42    static SVGLengthList initialValue() { return SVGLengthList(); }
     43    static String toString(const SVGLengthList& type) { return type.valueAsString(); }
     44};
     45
    3846} // namespace WebCore
    3947
  • trunk/WebCore/svg/SVGMarkerElement.h

    r71103 r73011  
    3030#include "SVGFitToViewBox.h"
    3131#include "SVGLangSpace.h"
     32#include "SVGPreserveAspectRatio.h"
     33#include "SVGRect.h"
    3234#include "SVGStyledElement.h"
    3335
  • trunk/WebCore/svg/SVGNumberList.h

    r70979 r73011  
    2323
    2424#if ENABLE(SVG)
     25#include "SVGPropertyTraits.h"
    2526#include <wtf/Vector.h>
    26 #include <wtf/text/WTFString.h>
    2727
    2828namespace WebCore {
     
    3636};
    3737
     38template<>
     39struct SVGPropertyTraits<SVGNumberList> {
     40    typedef float ListItemType;
     41
     42    static SVGNumberList initialValue() { return SVGNumberList(); }
     43    static String toString(const SVGNumberList& type) { return type.valueAsString(); }
     44};
     45
    3846} // namespace WebCore
    3947
  • trunk/WebCore/svg/SVGPatternElement.h

    r71802 r73011  
    2929#include "SVGFitToViewBox.h"
    3030#include "SVGLangSpace.h"
     31#include "SVGPreserveAspectRatio.h"
     32#include "SVGRect.h"
    3133#include "SVGStyledElement.h"
    3234#include "SVGTests.h"
  • trunk/WebCore/svg/SVGPointList.h

    r71512 r73011  
    2424#if ENABLE(SVG)
    2525#include "QualifiedName.h"
     26#include "SVGPropertyTraits.h"
    2627#include <wtf/Vector.h>
    27 #include <wtf/text/WTFString.h>
    2828
    2929namespace WebCore {
     
    4040};
    4141
     42template<>
     43struct SVGPropertyTraits<SVGPointList> {
     44    static SVGPointList initialValue() { return SVGPointList(); }
     45    typedef FloatPoint ListItemType;
     46};
     47
    4248} // namespace WebCore
    4349
  • trunk/WebCore/svg/SVGPreserveAspectRatio.h

    r71103 r73011  
    2424#if ENABLE(SVG)
    2525#include "ExceptionCode.h"
    26 #include <wtf/text/WTFString.h>
     26#include "SVGPropertyTraits.h"
    2727
    2828namespace WebCore {
     
    8787};
    8888
     89template<>
     90struct SVGPropertyTraits<SVGPreserveAspectRatio> {
     91    static SVGPreserveAspectRatio initialValue() { return SVGPreserveAspectRatio(); }
     92    static String toString(const SVGPreserveAspectRatio& type) { return type.valueAsString(); }
     93};
     94
    8995} // namespace WebCore
    9096
  • trunk/WebCore/svg/SVGSVGElement.h

    r71802 r73011  
    2929#include "SVGFitToViewBox.h"
    3030#include "SVGLangSpace.h"
     31#include "SVGPreserveAspectRatio.h"
     32#include "SVGRect.h"
    3133#include "SVGStyledLocatableElement.h"
    3234#include "SVGTests.h"
  • trunk/WebCore/svg/SVGStringList.h

    r72518 r73011  
    2424#if ENABLE(SVG)
    2525#include "QualifiedName.h"
     26#include "SVGPropertyTraits.h"
    2627#include <wtf/Vector.h>
    27 #include <wtf/text/WTFString.h>
    2828
    2929namespace WebCore {
     
    5050};
    5151
     52template<>
     53struct SVGPropertyTraits<SVGStringList> {
     54    typedef String ListItemType;
     55};
     56
    5257} // namespace WebCore
    5358
  • trunk/WebCore/svg/SVGSymbolElement.h

    r71103 r73011  
    2727#include "SVGFitToViewBox.h"
    2828#include "SVGLangSpace.h"
     29#include "SVGPreserveAspectRatio.h"
     30#include "SVGRect.h"
    2931#include "SVGStyledElement.h"
    3032
  • trunk/WebCore/svg/SVGTransformList.h

    r71802 r73011  
    2323
    2424#if ENABLE(SVG)
     25#include "SVGPropertyTraits.h"
    2526#include "SVGTransform.h"
    2627#include <wtf/Vector.h>
    27 #include <wtf/text/WTFString.h>
    2828
    2929namespace WebCore {
     
    4242};
    4343
     44template<>
     45struct SVGPropertyTraits<SVGTransformList> {
     46    static SVGTransformList initialValue() { return SVGTransformList(); }
     47    static String toString(const SVGTransformList& type) { return type.valueAsString(); }
     48    typedef SVGTransform ListItemType;
     49};
     50
    4451} // namespace WebCore
    4552
  • trunk/WebCore/svg/SVGViewElement.h

    r71227 r73011  
    2424#if ENABLE(SVG)
    2525#include "SVGAnimatedPropertyMacros.h"
     26#include "SVGExternalResourcesRequired.h"
     27#include "SVGFitToViewBox.h"
     28#include "SVGPreserveAspectRatio.h"
     29#include "SVGRect.h"
    2630#include "SVGStringList.h"
    2731#include "SVGStyledElement.h"
    28 #include "SVGExternalResourcesRequired.h"
    29 #include "SVGFitToViewBox.h"
    3032#include "SVGZoomAndPan.h"
    3133
  • trunk/WebCore/svg/SVGViewSpec.h

    r71802 r73011  
    2525#include "SVGElement.h"
    2626#include "SVGFitToViewBox.h"
     27#include "SVGPreserveAspectRatio.h"
     28#include "SVGRect.h"
    2729#include "SVGZoomAndPan.h"
    2830
  • trunk/WebCore/svg/properties/SVGListProperty.h

    r72518 r73011  
    2222
    2323#if ENABLE(SVG)
    24 #include "ExceptionCode.h"
    2524#include "SVGAnimatedProperty.h"
     25#include "SVGException.h"
    2626#include "SVGPropertyTearOff.h"
    2727#include "SVGPropertyTraits.h"
  • trunk/WebCore/svg/properties/SVGPropertyTraits.h

    r71802 r73011  
    2323
    2424#if ENABLE(SVG)
    25 #include "FloatRect.h"
    26 #include "SVGAngle.h"
    27 #include "SVGLength.h"
    28 #include "SVGLengthList.h"
    29 #include "SVGNumberList.h"
    30 #include "SVGPointList.h"
    31 #include "SVGPreserveAspectRatio.h"
    32 #include "SVGStringList.h"
    33 #include "SVGTransformList.h"
    34 #include <wtf/text/StringBuilder.h>
     25#include <wtf/text/WTFString.h>
    3526
    3627namespace WebCore {
     
    3829template<typename PropertyType>
    3930struct SVGPropertyTraits { };
    40 
    41 template<>
    42 struct SVGPropertyTraits<SVGAngle> {
    43     static SVGAngle initialValue() { return SVGAngle(); }
    44     static String toString(const SVGAngle& type) { return type.valueAsString(); }
    45 };
    4631
    4732template<>
     
    6449
    6550template<>
    66 struct SVGPropertyTraits<SVGLength> {
    67     static SVGLength initialValue() { return SVGLength(); }
    68     static String toString(const SVGLength& type) { return type.valueAsString(); }
    69 };
    70 
    71 template<>
    72 struct SVGPropertyTraits<SVGLengthList> {
    73     typedef SVGLength ListItemType;
    74 
    75     static SVGLengthList initialValue() { return SVGLengthList(); }
    76     static String toString(const SVGLengthList& type) { return type.valueAsString(); }
    77 };
    78 
    79 template<>
    8051struct SVGPropertyTraits<float> {
    8152    static float initialValue() { return 0; }
    8253    static String toString(float type) { return String::number(type); }
    83 };
    84 
    85 template<>
    86 struct SVGPropertyTraits<SVGNumberList> {
    87     typedef float ListItemType;
    88 
    89     static SVGNumberList initialValue() { return SVGNumberList(); }
    90     static String toString(const SVGNumberList& type) { return type.valueAsString(); }
    91 };
    92 
    93 template<>
    94 struct SVGPropertyTraits<SVGPreserveAspectRatio> {
    95     static SVGPreserveAspectRatio initialValue() { return SVGPreserveAspectRatio(); }
    96     static String toString(const SVGPreserveAspectRatio& type) { return type.valueAsString(); }
    97 };
    98 
    99 template<>
    100 struct SVGPropertyTraits<FloatRect> {
    101     static FloatRect initialValue() { return FloatRect(); }
    102     static String toString(const FloatRect& type)
    103     {
    104         StringBuilder builder;
    105         builder.append(String::number(type.x()));
    106         builder.append(' ');
    107         builder.append(String::number(type.y()));
    108         builder.append(' ');
    109         builder.append(String::number(type.width()));
    110         builder.append(' ');
    111         builder.append(String::number(type.height()));
    112         builder.append(' ');
    113         return builder.toString();
    114     }
    11554};
    11655
     
    12160};
    12261
    123 template<>
    124 struct SVGPropertyTraits<SVGStringList> {
    125     typedef String ListItemType;
    126 };
    127 
    128 template<>
    129 struct SVGPropertyTraits<SVGPointList> {
    130     static SVGPointList initialValue() { return SVGPointList(); }
    131     typedef FloatPoint ListItemType;
    132 };
    133 
    134 template<>
    135 struct SVGPropertyTraits<SVGTransformList> {
    136     static SVGTransformList initialValue() { return SVGTransformList(); }
    137     static String toString(const SVGTransformList& type) { return type.valueAsString(); }
    138     typedef SVGTransform ListItemType;
    139 };
    140 
    14162}
    14263
  • trunk/WebCore/svg/properties/SVGTransformListPropertyTearOff.h

    r72400 r73011  
    2323#if ENABLE(SVG)
    2424#include "SVGListPropertyTearOff.h"
     25#include "SVGTransformList.h"
    2526
    2627namespace WebCore {
Note: See TracChangeset for help on using the changeset viewer.