[webkit-changes] cvs commit: SVGSupport/ksvg2/svg SVGStyledTransformableElementImpl.cpp

Eric eseidel at opensource.apple.com
Mon Nov 21 03:59:59 PST 2005


eseidel     05/11/21 03:59:59

  Modified:    .        ChangeLog
               WebCore.xcodeproj project.pbxproj
               ksvg2/css KSVGCSSParser.cpp SVGCSSStyleSelector.cpp
                        cssproperties.in cssvalues.in
               ksvg2/svg SVGStyledTransformableElementImpl.cpp
  Log:
  Bug #: none
  Submitted by: eseidel
  Reviewed by: No review required, SVG target only.
          Fix SVG from having duplicate entries (with khtml) in its
          cssproperties.in and cssvalues.in files.  I've added an explicit
          check in the build phase for duplicates to prevent this in the
          future.  Minor code adjustments were necessary to use these
          the khtml value & property ids.
  
          No additional test cases needed, this change fixes:
          W3C-SVG-1.1/painting-stroke-02-t
          W3C-SVG-1.1/painting-stroke-03-t
  
          * WebCore.xcodeproj/project.pbxproj: duplicate id check
          * ksvg2/css/KSVGCSSParser.cpp:
          (DOM::CSSParser::parseSVGValue):
          * ksvg2/css/SVGCSSStyleSelector.cpp:
          (KDOM::CSSStyleSelector::applySVGProperty):
          * ksvg2/css/cssproperties.in: commented out duplicates
          * ksvg2/css/cssvalues.in: commented out duplicates
          * ksvg2/svg/SVGStyledTransformableElementImpl.cpp:
          (SVGStyledTransformableElementImpl::parseMappedAttribute):
  
  Revision  Changes    Path
  1.389     +24 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.388
  retrieving revision 1.389
  diff -u -r1.388 -r1.389
  --- ChangeLog	21 Nov 2005 08:29:03 -0000	1.388
  +++ ChangeLog	21 Nov 2005 11:59:53 -0000	1.389
  @@ -1,3 +1,27 @@
  +2005-11-21  eseidel  <eseidel at apple.com>
  +
  +        No review required, SVG target only.
  +
  +        Fix SVG from having duplicate entries (with khtml) in its
  +        cssproperties.in and cssvalues.in files.  I've added an explicit
  +        check in the build phase for duplicates to prevent this in the
  +        future.  Minor code adjustments were necessary to use these
  +        the khtml value & property ids.
  +
  +        No additional test cases needed, this change fixes:
  +        W3C-SVG-1.1/painting-stroke-02-t
  +        W3C-SVG-1.1/painting-stroke-03-t
  +
  +        * WebCore.xcodeproj/project.pbxproj: duplicate id check
  +        * ksvg2/css/KSVGCSSParser.cpp:
  +        (DOM::CSSParser::parseSVGValue):
  +        * ksvg2/css/SVGCSSStyleSelector.cpp:
  +        (KDOM::CSSStyleSelector::applySVGProperty):
  +        * ksvg2/css/cssproperties.in: commented out duplicates
  +        * ksvg2/css/cssvalues.in: commented out duplicates
  +        * ksvg2/svg/SVGStyledTransformableElementImpl.cpp:
  +        (SVGStyledTransformableElementImpl::parseMappedAttribute):
  +
   2005-11-20  Eric Seidel  <eseidel at apple.com>
   
           Only affects SVG; no review required (or possible due to size).
  
  
  
  1.44      +2 -2      WebCore/WebCore.xcodeproj/project.pbxproj
  
  Index: project.pbxproj
  ===================================================================
  RCS file: /cvs/root/WebCore/WebCore.xcodeproj/project.pbxproj,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- project.pbxproj	21 Nov 2005 08:29:09 -0000	1.43
  +++ project.pbxproj	21 Nov 2005 11:59:57 -0000	1.44
  @@ -6543,7 +6543,7 @@
   			);
   			runOnlyForDeploymentPostprocessing = 0;
   			shellPath = /bin/sh;
  -			shellScript = "cat ksvg2/css/cssproperties.in > \"$DERIVED_FILE_DIR/ksvgcssproperties.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakeprops\" -n KSVG -f ksvgcssproperties.in";
  +			shellScript = "echo \"First checking for duplicate cssproperties between html and SVG...\"\ncat khtml/css/cssproperties.in ksvg2/css/cssproperties.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'\nif [ $? -eq 0 ]; then\n\techo \"Duplicate property!\";\n\texit 1;\nfi\n\ncat ksvg2/css/cssproperties.in > \"$DERIVED_FILE_DIR/ksvgcssproperties.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakeprops\" -n KSVG -f ksvgcssproperties.in";
   		};
   		A837AEF308B6992C00EBFFDC /* ksvgcssvalues.c/h */ = {
   			isa = PBXShellScriptBuildPhase;
  @@ -6561,7 +6561,7 @@
   			);
   			runOnlyForDeploymentPostprocessing = 0;
   			shellPath = /bin/sh;
  -			shellScript = "cat ksvg2/css/cssvalues.in > \"$DERIVED_FILE_DIR/ksvgcssvalues.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakevalues\" -n KSVG -f ksvgcssvalues.in";
  +			shellScript = "echo \"First checking for duplicate cssvalues between html and SVG...\"\ncat khtml/css/cssvalues.in ksvg2/css/cssvalues.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'\nif [ $? -eq 0 ]; then\n\techo \"Duplicate value!\";\n\texit 1;\nfi\n\ncat ksvg2/css/cssvalues.in > \"$DERIVED_FILE_DIR/ksvgcssvalues.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakevalues\" -n KSVG -f ksvgcssvalues.in";
   		};
   		A83C867D0911AA19009BF4A7 /* XSLTProcessor.lut.h */ = {
   			isa = PBXShellScriptBuildPhase;
  
  
  
  1.9       +5 -5      SVGSupport/ksvg2/css/KSVGCSSParser.cpp
  
  Index: KSVGCSSParser.cpp
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/css/KSVGCSSParser.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- KSVGCSSParser.cpp	21 Nov 2005 08:29:27 -0000	1.8
  +++ KSVGCSSParser.cpp	21 Nov 2005 11:59:58 -0000	1.9
  @@ -64,8 +64,8 @@
       // auto | baseline | before-edge | text-before-edge | middle |
       // central | after-edge | text-after-edge | ideographic | alphabetic |
       // hanging | mathematical | inherit
  -        if(id == CSS_VAL_AUTO || id == CSS_VAL_MIDDLE ||
  -          (id >= SVGCSS_VAL_BASELINE && id <= SVGCSS_VAL_MATHEMATICAL))
  +        if(id == CSS_VAL_AUTO || id == CSS_VAL_BASELINE || id == CSS_VAL_MIDDLE ||
  +          (id >= SVGCSS_VAL_BEFORE_EDGE && id <= SVGCSS_VAL_MATHEMATICAL))
               valid_primitive = true;
           break;
   
  @@ -119,12 +119,12 @@
           break;
   
       case SVGCSS_PROP_STROKE_LINEJOIN:   // miter | round | bevel | inherit
  -        if(id == SVGCSS_VAL_MITER || id == SVGCSS_VAL_ROUND || id == SVGCSS_VAL_BEVEL)
  +        if(id == SVGCSS_VAL_MITER || id == CSS_VAL_ROUND || id == SVGCSS_VAL_BEVEL)
               valid_primitive = true;
           break;
   
       case SVGCSS_PROP_STROKE_LINECAP:    // butt | round | square | inherit
  -        if(id == SVGCSS_VAL_BUTT || id == SVGCSS_VAL_ROUND || id == SVGCSS_VAL_SQUARE)
  +        if(id == SVGCSS_VAL_BUTT || id == CSS_VAL_ROUND || id == CSS_VAL_SQUARE)
               valid_primitive = true;
           break;
   
  @@ -179,7 +179,7 @@
           break;
   
       case SVGCSS_PROP_TEXT_ANCHOR:    // start | middle | end | inherit
  -        if(id >= SVGCSS_VAL_START && id <= SVGCSS_VAL_END)
  +        if(id == CSS_VAL_START || id == CSS_VAL_MIDDLE || id == CSS_VAL_END)
               valid_primitive = true;
           break;
   
  
  
  
  1.10      +35 -7     SVGSupport/ksvg2/css/SVGCSSStyleSelector.cpp
  
  Index: SVGCSSStyleSelector.cpp
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/css/SVGCSSStyleSelector.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SVGCSSStyleSelector.cpp	21 Nov 2005 08:29:28 -0000	1.9
  +++ SVGCSSStyleSelector.cpp	21 Nov 2005 11:59:58 -0000	1.10
  @@ -119,7 +119,7 @@
                   case CSS_VAL_AUTO:
                       svgstyle->setAlignmentBaseline(AB_AUTO);
                       break;
  -                case SVGCSS_VAL_BASELINE:
  +                case CSS_VAL_BASELINE:
                       svgstyle->setAlignmentBaseline(AB_BASELINE);
                       break;
                   case SVGCSS_VAL_BEFORE_EDGE:
  @@ -343,7 +343,7 @@
                   case SVGCSS_VAL_MITER:
                       svgstyle->setJoinStyle(JS_MITER);
                       break;
  -                case SVGCSS_VAL_ROUND:
  +                case CSS_VAL_ROUND:
                       svgstyle->setJoinStyle(JS_ROUND);
                       break;
                   case SVGCSS_VAL_BEVEL:
  @@ -530,8 +530,22 @@
           case SVGCSS_PROP_STROKE_LINECAP:
           {
               HANDLE_INHERIT_AND_INITIAL(capStyle, CapStyle)
  -            if(primitiveValue)
  -                svgstyle->setCapStyle((ECapStyle)(primitiveValue->getIdent() - SVGCSS_VAL_GEOMETRICPRECISION));
  +            if (!primitiveValue)
  +                break;
  +            
  +            switch (primitiveValue->getIdent())
  +            {
  +                case SVGCSS_VAL_BUTT:
  +                    svgstyle->setCapStyle(CS_BUTT);
  +                    break;
  +                case CSS_VAL_ROUND:
  +                    svgstyle->setCapStyle(CS_ROUND);
  +                    break;
  +                case CSS_VAL_SQUARE:
  +                    svgstyle->setCapStyle(CS_SQUARE);
  +                default:
  +                    return;
  +            }
   
               break;
           }
  @@ -585,9 +599,23 @@
           case SVGCSS_PROP_TEXT_ANCHOR:
           {
               HANDLE_INHERIT_AND_INITIAL(textAnchor, TextAnchor)
  -            if(primitiveValue)
  -                svgstyle->setTextAnchor((ETextAnchor)(primitiveValue->getIdent() - SVGCSS_VAL_RESET_SIZE));
  -                
  +            if (!primitiveValue)
  +                break;
  +            
  +            switch(primitiveValue->getIdent())
  +            {
  +                case CSS_VAL_START:
  +                    svgstyle->setTextAnchor(TA_START);
  +                    break;
  +                case CSS_VAL_MIDDLE:
  +                    svgstyle->setTextAnchor(TA_MIDDLE);
  +                    break;
  +                case CSS_VAL_END:
  +                    svgstyle->setTextAnchor(TA_END);
  +                default:
  +                    return;
  +            }
  +            
               break;
           }
   #if 0
  
  
  
  1.2       +1 -1      SVGSupport/ksvg2/css/cssproperties.in
  
  Index: cssproperties.in
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/css/cssproperties.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cssproperties.in	9 Jul 2005 06:54:48 -0000	1.1
  +++ cssproperties.in	21 Nov 2005 11:59:58 -0000	1.2
  @@ -6,7 +6,7 @@
   clip-path
   clip-rule
   mask
  -opacity
  +# opacity
   enable-background
   filter
   flood-color
  
  
  
  1.2       +27 -27    SVGSupport/ksvg2/css/cssvalues.in
  
  Index: cssvalues.in
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/css/cssvalues.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cssvalues.in	9 Jul 2005 06:54:48 -0000	1.1
  +++ cssvalues.in	21 Nov 2005 11:59:58 -0000	1.2
  @@ -14,14 +14,14 @@
   #
   aliceblue
   antiquewhite
  -aqua
  +# aqua
   aquamarine
   azure
   beige
   bisque
  -black
  +# black
   blanchedalmond
  -blue
  +# blue
   blueviolet
   brown
   burlywood
  @@ -60,14 +60,14 @@
   firebrick
   floralwhite
   forestgreen
  -fuchsia
  +# fuchsia
   gainsboro
   ghostwhite
   gold
   goldenrod
  -gray
  -grey
  -green
  +# gray
  +# grey
  +# green
   greenyellow
   honeydew
   hotpink
  @@ -94,11 +94,11 @@
   lightslategrey
   lightsteelblue
   lightyellow
  -lime
  +# lime
   limegreen
   linen
   magenta
  -maroon
  +# maroon
   mediumaquamarine
   mediumblue
   mediumorchid
  @@ -113,11 +113,11 @@
   mistyrose
   moccasin
   navajowhite
  -navy
  +# navy
   oldlace
  -olive
  +# olive
   olivedrab
  -orange
  +# orange
   orangered
   orchid
   palegoldenrod
  @@ -130,8 +130,8 @@
   pink
   plum
   powderblue
  -purple
  -red
  +# purple
  +# red
   rosybrown
   royalblue
   saddlebrown
  @@ -140,7 +140,7 @@
   seagreen
   seashell
   sienna
  -silver
  +# silver
   skyblue
   slateblue
   slategray
  @@ -149,15 +149,15 @@
   springgreen
   steelblue
   tan
  -teal
  +# teal
   thistle
   tomato
   turquoise
   violet
   wheat
  -white
  +# white
   whitesmoke
  -yellow
  +# yellow
   yellowgreen
   
   # CSS_PROP_CLIP_PATH
  @@ -238,12 +238,12 @@
   # CSS_PROP_STROKE_DASHOFFSET
   # CSS_PROP_STROKE_LINECAP
   butt
  -round
  -square
  +# round
  +# square
   
   # CSS_PROP_STROKE_LINEJOIN
   miter
  -#round
  +# round
   bevel
   
   # CSS_PROP_STROKE_MITERLIMIT
  @@ -257,7 +257,7 @@
   
   # CSS_PROP_ALIGNMENT_BASELINE
   #auto
  -baseline
  +# baseline
   before-edge
   after-edge
   #middle
  @@ -271,8 +271,8 @@
   
   # CSS_PROP_BASELINE_SHIFT
   #baseline
  -sub
  -super
  +# sub
  +# super
   
   # CSS_PROP_DOMINANT_BASELINE
   #auto
  @@ -285,9 +285,9 @@
   # CSS_PROP_GLYP_ORIENTATION_VERTICAL
   # CSS_PROP_KERNING
   # CSS_PROP_TEXT_ANCHOR
  -start
  -middle
  -end
  +# start
  +# middle
  +# end
   
   # CSS_PROP_WRITING_MODE
   lr-tb
  
  
  
  1.2       +2 -4      SVGSupport/ksvg2/svg/SVGStyledTransformableElementImpl.cpp
  
  Index: SVGStyledTransformableElementImpl.cpp
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/svg/SVGStyledTransformableElementImpl.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SVGStyledTransformableElementImpl.cpp	21 Nov 2005 08:29:42 -0000	1.1
  +++ SVGStyledTransformableElementImpl.cpp	21 Nov 2005 11:59:59 -0000	1.2
  @@ -103,15 +103,13 @@
       if(attr->name() == SVGNames::transformAttr)
       {
           SVGTransformListImpl *localTransforms = transform()->baseVal();
  -
           localTransforms->clear();
  +        
           SVGTransformableImpl::parseTransformAttribute(localTransforms, attr->value().impl());
  -
  -        // Update cached local matrix
           updateLocalTransform(localTransforms);
       }
       else
  -        SVGStyledElementImpl::parseMappedAttribute(attr);
  +        SVGStyledLocatableElementImpl::parseMappedAttribute(attr);
   }
   
   SVGElementImpl *SVGStyledTransformableElementImpl::nearestViewportElement() const
  
  
  



More information about the webkit-changes mailing list