Changeset 38439 in webkit


Ignore:
Timestamp:
Nov 15, 2008 8:35:22 PM (15 years ago)
Author:
Darin Adler
Message:

2008-11-15 Darin Adler <Darin Adler>

Reviewed by Dan Bernstein.

  • fix just-introduced crash in the svg/custom/svg-fonts-in-html.html test

This gets rid of the crash. It restores the behavior of the CG case from before Dirk
Shulze removed the platorm-dependent code, but perhaps it should be changed further
in the future so that the default for no style is "no stroke". I think the patch is
fine for fill.

  • svg/graphics/SVGPaintServerSolid.cpp: (WebCore::SVGPaintServerSolid::setup): Added null checks for svgStyle. (WebCore::SVGPaintServerSolid::renderPath): Added null checks for style and svgStyle.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r38436 r38439  
     12008-11-15  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        - fix just-introduced crash in the svg/custom/svg-fonts-in-html.html test
     6
     7        This gets rid of the crash. It restores the behavior of the CG case from before Dirk
     8        Shulze removed the platorm-dependent code, but perhaps it should be changed further
     9        in the future so that the default for no style is "no stroke". I think the patch is
     10        fine for fill.
     11
     12        * svg/graphics/SVGPaintServerSolid.cpp:
     13        (WebCore::SVGPaintServerSolid::setup): Added null checks for svgStyle.
     14        (WebCore::SVGPaintServerSolid::renderPath): Added null checks for style and svgStyle.
     15
    1162008-11-15  Kevin Ollivier  <kevino@theolliviers.com>
    217
  • trunk/WebCore/svg/graphics/SVGPaintServerSolid.cpp

    r38435 r38439  
    6464{
    6565    RenderStyle* style = object ? object->style() : 0;
    66     const SVGRenderStyle* svgStyle = object ? object->style()->svgStyle() : 0;
     66    const SVGRenderStyle* svgStyle = style ? style->svgStyle() : 0;
    6767
    6868    if ((type & ApplyToFillTargetType) && (!style || svgStyle->hasFill())) {
    69         context->setAlpha(svgStyle->fillOpacity());
     69        context->setAlpha(style ? svgStyle->fillOpacity() : 1);
    7070        context->setFillColor(color().rgb());
    71         context->setFillRule(svgStyle->fillRule());
     71        context->setFillRule(style ? svgStyle->fillRule() : RULE_NONZERO);
    7272
    7373        if (isPaintingText)
     
    7676
    7777    if ((type & ApplyToStrokeTargetType) && (!style || svgStyle->hasStroke())) {
    78         context->setAlpha(svgStyle->strokeOpacity());
     78        context->setAlpha(style ? svgStyle->strokeOpacity() : 1);
    7979        context->setStrokeColor(color().rgb());
    8080
     
    9191void SVGPaintServerSolid::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
    9292{
    93     const SVGRenderStyle* svgStyle = path->style()->svgStyle();
     93    const SVGRenderStyle* svgStyle = path ? path->style()->svgStyle() : 0;
    9494
    95     if ((type & ApplyToFillTargetType) && svgStyle->hasFill())
     95    if ((type & ApplyToFillTargetType) && (!svgStyle || svgStyle->hasFill()))
    9696        context->fillPath();
    9797
    98     if ((type & ApplyToStrokeTargetType) && svgStyle->hasStroke())
     98    if ((type & ApplyToStrokeTargetType) && (!svgStyle || svgStyle->hasStroke()))
    9999        context->strokePath();
    100100}
Note: See TracChangeset for help on using the changeset viewer.