[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:36:29 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 16c3b1c10109610d7422e247309cbac35dd7107f
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 30 19:06:26 2010 +0000

    2010-07-30  fsamuel at chromium.org  <fsamuel at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Expand SVG Attribute Macros
            https://bugs.webkit.org/show_bug.cgi?id=43254
    
            Expanded SVG Attribute Macros to reduce debugging headache.
    
            No change in behavior, so no new tests.
    
            * rendering/style/SVGRenderStyle.h: Expanded and removed references to SVG_RS_DEFINE_ATTRIBUTE* macros.
            * rendering/style/SVGRenderStyleDefs.h: Removed definitons for expanded macros.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64367 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dc02485..6b1199c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-07-30  fsamuel at chromium.org  <fsamuel at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Expand SVG Attribute Macros
+        https://bugs.webkit.org/show_bug.cgi?id=43254
+
+        Expanded SVG Attribute Macros to reduce debugging headache.
+
+        No change in behavior, so no new tests.
+
+        * rendering/style/SVGRenderStyle.h: Expanded and removed references to SVG_RS_DEFINE_ATTRIBUTE* macros.
+        * rendering/style/SVGRenderStyleDefs.h: Removed definitons for expanded macros.
+
 2010-07-30  Kinuko Yasuda  <kinuko at chromium.org>
 
         Reviewed by Dumitru Daniliuc.
diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h
index c87dd2b..c1d72e9 100644
--- a/WebCore/rendering/style/SVGRenderStyle.h
+++ b/WebCore/rendering/style/SVGRenderStyle.h
@@ -56,59 +56,237 @@ public:
     bool operator==(const SVGRenderStyle&) const;
     bool operator!=(const SVGRenderStyle& o) const { return !(*this == o); }
 
-    // SVG CSS Properties
-    SVG_RS_DEFINE_ATTRIBUTE(EAlignmentBaseline, AlignmentBaseline, alignmentBaseline, AB_AUTO)
-    SVG_RS_DEFINE_ATTRIBUTE(EDominantBaseline, DominantBaseline, dominantBaseline, DB_AUTO)
-    SVG_RS_DEFINE_ATTRIBUTE(EBaselineShift, BaselineShift, baselineShift, BS_BASELINE)
-    SVG_RS_DEFINE_ATTRIBUTE(EVectorEffect, VectorEffect, vectorEffect, VE_NONE)
-
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(LineCap, CapStyle, capStyle, ButtCap)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(WindRule, ClipRule, clipRule, RULE_NONZERO)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EColorInterpolation, ColorInterpolation, colorInterpolation, CI_SRGB)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EColorInterpolation, ColorInterpolationFilters, colorInterpolationFilters, CI_LINEARRGB)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EColorRendering, ColorRendering, colorRendering, CR_AUTO)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(WindRule, FillRule, fillRule, RULE_NONZERO)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EImageRendering, ImageRendering, imageRendering, IR_AUTO)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(LineJoin, JoinStyle, joinStyle, MiterJoin)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EShapeRendering, ShapeRendering, shapeRendering, SR_AUTO)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(ETextAnchor, TextAnchor, textAnchor, TA_START)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EWritingMode, WritingMode, writingMode, WM_LRTB)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EGlyphOrientation, GlyphOrientationHorizontal, glyphOrientationHorizontal, GO_0DEG)
-    SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EGlyphOrientation, GlyphOrientationVertical, glyphOrientationVertical, GO_AUTO)
-
-    // SVG CSS Properties (using DataRef's)
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, fill, opacity, FillOpacity, fillOpacity, 1.0f)
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(SVGPaint, fill, paint, FillPaint, fillPaint, SVGPaint::defaultFill())
-
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stroke, opacity, StrokeOpacity, strokeOpacity, 1.0f)
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(SVGPaint, stroke, paint, StrokePaint, strokePaint, SVGPaint::defaultStroke())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValueList, stroke, dashArray, StrokeDashArray, strokeDashArray, 0)
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stroke, miterLimit, StrokeMiterLimit, strokeMiterLimit, 4.0f)
+    // Initial values for all the properties
+    static EAlignmentBaseline initialAlignmentBaseline() { return AB_AUTO; }
+    static EDominantBaseline initialDominantBaseline() { return DB_AUTO; }
+    static EBaselineShift initialBaselineShift() { return BS_BASELINE; }
+    static EVectorEffect initialVectorEffect() { return VE_NONE; }
+    static LineCap initialCapStyle() { return ButtCap; }
+    static WindRule initialClipRule() { return RULE_NONZERO; }
+    static EColorInterpolation initialColorInterpolation() { return CI_SRGB; }
+    static EColorInterpolation initialColorInterpolationFilters() { return CI_LINEARRGB; }
+    static EColorRendering initialColorRendering() { return CR_AUTO; }
+    static WindRule initialFillRule() { return RULE_NONZERO; }
+    static EImageRendering initialImageRendering() { return IR_AUTO; }
+    static LineJoin initialJoinStyle() { return MiterJoin; }
+    static EShapeRendering initialShapeRendering() { return SR_AUTO; }
+    static ETextAnchor initialTextAnchor() { return TA_START; }
+    static EWritingMode initialWritingMode() { return WM_LRTB; }
+    static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DEG; }
+    static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO; }
+    static float initialFillOpacity() { return 1.0f; }
+    static SVGPaint* initialFillPaint() { return SVGPaint::defaultFill(); }
+    static float initialStrokeOpacity() { return 1.0f; }
+    static SVGPaint* initialStrokePaint() { return SVGPaint::defaultStroke(); }
+    static CSSValueList* initialStrokeDashArray() { return 0; }
+    static float initialStrokeMiterLimit() { return 4.0f; }
+    static CSSValue* initialStrokeWidth() { return 0; }
+    static CSSValue* initialStrokeDashOffset() { return 0; };
+    static CSSValue* initialKerning() { return 0; }
+    static float initialStopOpacity() { return 1.0f; }
+    static Color initialStopColor() { return Color(0, 0, 0); }
+    static float initialFloodOpacity() { return 1.0f; }
+    static Color initialFloodColor() { return Color(0, 0, 0); }
+    static Color initialLightingColor() { return Color(255, 255, 255); }
+    static CSSValue* initialBaselineShiftValue() { return 0; }
+    static ShadowData* initialShadow() { return 0; }
+    static String initialClipperResource() { return String(); }
+    static String initialFilterResource() { return String(); }
+    static String initialMaskerResource() { return String(); }
+    static String initialMarkerStartResource() { return String(); }
+    static String initialMarkerMidResource() { return String(); }
+    static String initialMarkerEndResource() { return String(); }
+
+    // SVG CSS Property setters
+    void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f._alignmentBaseline = val; }
+    void setDominantBaseline(EDominantBaseline val) { svg_noninherited_flags.f._dominantBaseline = val; }
+    void setBaselineShift(EBaselineShift val) { svg_noninherited_flags.f._baselineShift = val; }
+    void setVectorEffect(EVectorEffect val) { svg_noninherited_flags.f._vectorEffect = val; }
+    void setCapStyle(LineCap val) { svg_inherited_flags._capStyle = val; }
+    void setClipRule(WindRule val) { svg_inherited_flags._clipRule = val; }
+    void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags._colorInterpolation = val; }
+    void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_flags._colorInterpolationFilters = val; }
+    void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRendering = val; }
+    void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; }
+    void setImageRendering(EImageRendering val) { svg_inherited_flags._imageRendering = val; }
+    void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; }
+    void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRendering = val; }
+    void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val; }
+    void setWritingMode(EWritingMode val) { svg_inherited_flags._writingMode = val; }
+    void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationHorizontal = val; }
+    void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationVertical = val; }
     
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, stroke, width, StrokeWidth, strokeWidth, 0)
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, stroke, dashOffset, StrokeDashOffset, strokeDashOffset, 0);
+    void setFillOpacity(float obj)
+    {
+        if (!(fill->opacity == obj))
+            fill.access()->opacity = obj;
+    }
+
+    void setFillPaint(PassRefPtr<SVGPaint> obj)
+    {
+        if (!(fill->paint == obj))
+            fill.access()->paint = obj;
+    }
+
+    void setStrokeOpacity(float obj)
+    {
+        if (!(stroke->opacity == obj))
+            stroke.access()->opacity = obj;
+    }
+
+    void setStrokePaint(PassRefPtr<SVGPaint> obj)
+    {
+        if (!(stroke->paint == obj))
+            stroke.access()->paint = obj;
+    }
+
+    void setStrokeDashArray(PassRefPtr<CSSValueList> obj)
+    {
+        if (!(stroke->dashArray == obj))
+            stroke.access()->dashArray = obj;
+    }
+
+    void setStrokeMiterLimit(float obj)
+    {
+        if (!(stroke->miterLimit == obj))
+            stroke.access()->miterLimit = obj;
+    }
 
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, text, kerning, Kerning, kerning, 0)
+    void setStrokeWidth(PassRefPtr<CSSValue> obj)
+    {
+        if (!(stroke->width == obj))
+            stroke.access()->width = obj;
+    }
 
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stops, opacity, StopOpacity, stopOpacity, 1.0f)
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, stops, color, StopColor, stopColor, Color(0, 0, 0))    
+    void setStrokeDashOffset(PassRefPtr<CSSValue> obj)
+    {
+        if (!(stroke->dashOffset == obj))
+            stroke.access()->dashOffset = obj;
+    }
 
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, misc, floodOpacity, FloodOpacity, floodOpacity, 1.0f)
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, misc, floodColor, FloodColor, floodColor, Color(0, 0, 0))
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, misc, lightingColor, LightingColor, lightingColor, Color(255, 255, 255))
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, misc, baselineShiftValue, BaselineShiftValue, baselineShiftValue, 0)
+    void setKerning(PassRefPtr<CSSValue> obj)
+    {
+        if (!(text->kerning == obj))
+            text.access()->kerning = obj;
+    }
 
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(ShadowData, shadowSVG, shadow, Shadow, shadow, 0)
+    void setStopOpacity(float obj)
+    {
+        if (!(stops->opacity == obj))
+            stops.access()->opacity = obj;
+    }
 
-    // Non-inherited resources
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, resources, clipper, ClipperResource, clipperResource, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, resources, filter, FilterResource, filterResource, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, resources, masker, MaskerResource, maskerResource, String())
+    void setStopColor(Color obj)
+    {
+        if (!(stops->color == obj))
+            stops.access()->color = obj;
+    }
+
+    void setFloodOpacity(float obj)
+    {
+        if (!(misc->floodOpacity == obj))
+            misc.access()->floodOpacity = obj;
+    }
+
+    void setFloodColor(Color obj)
+    {
+        if (!(misc->floodColor == obj))
+            misc.access()->floodColor = obj;
+    }
+
+    void setLightingColor(Color obj)
+    {
+        if (!(misc->lightingColor == obj))
+            misc.access()->lightingColor = obj;
+    }
+
+    void setBaselineShiftValue(PassRefPtr<CSSValue> obj)
+    {
+        if (!(misc->baselineShiftValue == obj))
+            misc.access()->baselineShiftValue = obj;
+    }
+
+    void setShadow(PassOwnPtr<ShadowData> obj) { shadowSVG.access()->shadow = obj;
+    }
+
+    // Setters for non-inherited resources
+    void setClipperResource(String obj)
+    {
+        if (!(resources->clipper == obj))
+            resources.access()->clipper = obj;
+    }
+
+    void setFilterResource(String obj)
+    {
+        if (!(resources->filter == obj))
+            resources.access()->filter = obj;
+    }
+
+    void setMaskerResource(String obj)
+    {
+        if (!(resources->masker == obj))
+            resources.access()->masker = obj;
+    }
+
+    // Setters for inherited resources
+    void setMarkerStartResource(String obj)
+    {
+        if (!(inheritedResources->markerStart == obj))
+            inheritedResources.access()->markerStart = obj;
+    }
+
+    void setMarkerMidResource(String obj)
+    {
+        if (!(inheritedResources->markerMid == obj))
+            inheritedResources.access()->markerMid = obj;
+    }
+
+    void setMarkerEndResource(String obj)
+    {
+        if (!(inheritedResources->markerEnd == obj))
+            inheritedResources.access()->markerEnd = obj;
+    }
 
-    // Inherited resources
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, inheritedResources, markerStart, MarkerStartResource, markerStartResource, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, inheritedResources, markerMid, MarkerMidResource, markerMidResource, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, inheritedResources, markerEnd, MarkerEndResource, markerEndResource, String())
+    // Read accessors for all the properties
+    EAlignmentBaseline alignmentBaseline() const { return (EAlignmentBaseline) svg_noninherited_flags.f._alignmentBaseline; }
+    EDominantBaseline dominantBaseline() const { return (EDominantBaseline) svg_noninherited_flags.f._dominantBaseline; }
+    EBaselineShift baselineShift() const { return (EBaselineShift) svg_noninherited_flags.f._baselineShift; }
+    EVectorEffect vectorEffect() const { return (EVectorEffect) svg_noninherited_flags.f._vectorEffect; }
+    LineCap capStyle() const { return (LineCap) svg_inherited_flags._capStyle; }
+    WindRule clipRule() const { return (WindRule) svg_inherited_flags._clipRule; }
+    EColorInterpolation colorInterpolation() const { return (EColorInterpolation) svg_inherited_flags._colorInterpolation; }
+    EColorInterpolation colorInterpolationFilters() const { return (EColorInterpolation) svg_inherited_flags._colorInterpolationFilters; }
+    EColorRendering colorRendering() const { return (EColorRendering) svg_inherited_flags._colorRendering; }
+    WindRule fillRule() const { return (WindRule) svg_inherited_flags._fillRule; }
+    EImageRendering imageRendering() const { return (EImageRendering) svg_inherited_flags._imageRendering; }
+    LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyle; }
+    EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inherited_flags._shapeRendering; }
+    ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._textAnchor; }
+    EWritingMode writingMode() const { return (EWritingMode) svg_inherited_flags._writingMode; }
+    EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationHorizontal; }
+    EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationVertical; }
+    float fillOpacity() const { return fill->opacity; }
+    SVGPaint* fillPaint() const { return fill->paint.get(); }
+    float strokeOpacity() const { return stroke->opacity; }
+    SVGPaint* strokePaint() const { return stroke->paint.get(); }
+    CSSValueList* strokeDashArray() const { return stroke->dashArray.get(); }
+    float strokeMiterLimit() const { return stroke->miterLimit; }
+    CSSValue* strokeWidth() const { return stroke->width.get(); }
+    CSSValue* strokeDashOffset() const { return stroke->dashOffset.get(); }
+    CSSValue* kerning() const { return text->kerning.get(); }
+    float stopOpacity() const { return stops->opacity; }
+    Color stopColor() const { return stops->color; }
+    float floodOpacity() const { return misc->floodOpacity; }
+    Color floodColor() const { return misc->floodColor; }
+    Color lightingColor() const { return misc->lightingColor; }
+    CSSValue* baselineShiftValue() const { return misc->baselineShiftValue.get(); }
+    ShadowData* shadow() const { return shadowSVG->shadow.get(); }
+    String clipperResource() const { return resources->clipper; }
+    String filterResource() const { return resources->filter; }
+    String maskerResource() const { return resources->masker; }
+    String markerStartResource() const { return inheritedResources->markerStart; }
+    String markerMidResource() const { return inheritedResources->markerMid; }
+    String markerEndResource() const { return inheritedResources->markerEnd; }
 
     // convenience
     bool hasClipper() const { return !clipperResource().isEmpty(); }
diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.h b/WebCore/rendering/style/SVGRenderStyleDefs.h
index 5173894..adb890c 100644
--- a/WebCore/rendering/style/SVGRenderStyleDefs.h
+++ b/WebCore/rendering/style/SVGRenderStyleDefs.h
@@ -38,46 +38,6 @@
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
-// Helper macros for 'SVGRenderStyle'
-#define SVG_RS_DEFINE_ATTRIBUTE(Data, Type, Name, Initial) \
-    void set##Type(Data val) { svg_noninherited_flags.f._##Name = val; } \
-    Data Name() const { return (Data) svg_noninherited_flags.f._##Name; } \
-    static Data initial##Type() { return Initial; }
-
-#define SVG_RS_DEFINE_ATTRIBUTE_INHERITED(Data, Type, Name, Initial) \
-    void set##Type(Data val) { svg_inherited_flags._##Name = val; } \
-    Data Name() const { return (Data) svg_inherited_flags._##Name; } \
-    static Data initial##Type() { return Initial; }
-
-// "Helper" macros for SVG's RenderStyle properties
-// FIXME: These are impossible to work with or debug.
-#define SVG_RS_DEFINE_ATTRIBUTE_DATAREF(Data, Group, Variable, Type, Name) \
-    Data Name() const { return Group->Variable; } \
-    void set##Type(Data obj) { SVG_RS_SET_VARIABLE(Group, Variable, obj) }
-
-#define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Data, Group, Variable, Type, Name, Initial) \
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF(Data, Group, Variable, Type, Name) \
-    static Data initial##Type() { return Initial; }
-
-#define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(Data, Group, Variable, Type, Name, Initial) \
-    Data* Name() const { return Group->Variable.get(); } \
-    void set##Type(PassRefPtr<Data> obj) { \
-        if (!(Group->Variable == obj)) \
-            Group.access()->Variable = obj; \
-    } \
-    static Data* initial##Type() { return Initial; }
-
-#define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(Data, Group, Variable, Type, Name, Initial) \
-    Data* Name() const { return Group->Variable.get(); } \
-    void set##Type(PassOwnPtr<Data> obj) { \
-        Group.access()->Variable = obj; \
-    } \
-    static Data* initial##Type() { return Initial; }
-
-#define SVG_RS_SET_VARIABLE(Group, Variable, Value) \
-    if (!(Group->Variable == Value)) \
-        Group.access()->Variable = Value;
-
 namespace WebCore {
 
     enum EBaselineShift {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list