Changeset 119391 in webkit


Ignore:
Timestamp:
Jun 4, 2012 6:23:16 AM (12 years ago)
Author:
pdr@google.com
Message:

Fix assert in non-scaling strokes in patterns
https://bugs.webkit.org/show_bug.cgi?id=88198

Source/WebCore:

When calculating the CTM for a rect or path in a pattern we need to use
an SVGPatternElement's local transform. Pattern did not expose the transform
because it does not extend from from SVGStyledLocatable or SVGStyledTransformable.
This patch exposes the pattern's transform in localCoordinateSpaceTransform.

SVGGradientElement does not need this special handling because the children
of a gradient element are restricted to not include shape and structural elements
that would need to calculate a CTM.

Before this patch the added test would assert.
This patch is a prerequisite to a major refactoring of RenderSVGShape &
friends, and the test will be unskipped in a followup patch.

Reviewed by Dirk Schulze.

Tests: svg/stroke/non-scaling-stroke-pattern-expected.svg

svg/stroke/non-scaling-stroke-pattern.svg

  • svg/SVGPatternElement.cpp:

(WebCore::SVGPatternElement::localCoordinateSpaceTransform):
(WebCore):

  • svg/SVGPatternElement.h:

(SVGPatternElement):

  • svg/SVGStyledElement.cpp:

(WebCore::SVGStyledElement::localCoordinateSpaceTransform):

LayoutTests:

Reviewed by Dirk Schulze.

  • platform/chromium/TestExpectations:
  • platform/mac/TestExpectations:
  • svg/stroke/non-scaling-stroke-pattern-expected.svg: Added.
  • svg/stroke/non-scaling-stroke-pattern.svg: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r119388 r119391  
     12012-06-04  Philip Rogers  <pdr@google.com>
     2
     3        Fix assert in non-scaling strokes in patterns
     4        https://bugs.webkit.org/show_bug.cgi?id=88198
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * platform/chromium/TestExpectations:
     9        * platform/mac/TestExpectations:
     10        * svg/stroke/non-scaling-stroke-pattern-expected.svg: Added.
     11        * svg/stroke/non-scaling-stroke-pattern.svg: Added.
     12
    1132012-06-04  Ilya Tikhonovsky  <loislo@chromium.org>
    214
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r119371 r119391  
    12281228BUGWK81243 : svg/repaint/repainting-after-animation-element-removal.svg = PASS IMAGE
    12291229
     1230BUGWK88198 : svg/stroke/non-scaling-stroke-pattern.svg = PASS IMAGE
     1231
    12301232BUGWK81493 LINUX : svg/custom/js-late-gradient-creation.svg = PASS IMAGE
    12311233
  • trunk/LayoutTests/platform/mac/TestExpectations

    r119317 r119391  
    200200BUGWK85401 : media/video-colorspace-yuv422.html = TEXT
    201201
     202BUGWK88198 : svg/stroke/non-scaling-stroke-pattern.svg = PASS IMAGE
     203
    202204BUGWK85404 : fast/loader/javascript-url-in-embed.html = TEXT PASS
    203205
  • trunk/Source/WebCore/ChangeLog

    r119389 r119391  
     12012-06-04  Philip Rogers  <pdr@google.com>
     2
     3        Fix assert in non-scaling strokes in patterns
     4        https://bugs.webkit.org/show_bug.cgi?id=88198
     5
     6        When calculating the CTM for a rect or path in a pattern we need to use
     7        an SVGPatternElement's local transform. Pattern did not expose the transform
     8        because it does not extend from from SVGStyledLocatable or SVGStyledTransformable.
     9        This patch exposes the pattern's transform in localCoordinateSpaceTransform.
     10
     11        SVGGradientElement does not need this special handling because the children
     12        of a gradient element are restricted to not include shape and structural elements
     13        that would need to calculate a CTM.
     14
     15        Before this patch the added test would assert.
     16        This patch is a prerequisite to a major refactoring of RenderSVGShape &
     17        friends, and the test will be unskipped in a followup patch.
     18
     19        Reviewed by Dirk Schulze.
     20
     21        Tests: svg/stroke/non-scaling-stroke-pattern-expected.svg
     22               svg/stroke/non-scaling-stroke-pattern.svg
     23
     24        * svg/SVGPatternElement.cpp:
     25        (WebCore::SVGPatternElement::localCoordinateSpaceTransform):
     26        (WebCore):
     27        * svg/SVGPatternElement.h:
     28        (SVGPatternElement):
     29        * svg/SVGStyledElement.cpp:
     30        (WebCore::SVGStyledElement::localCoordinateSpaceTransform):
     31
    1322012-06-04  Alexei Filippov  <alexeif@chromium.org>
    233
  • trunk/Source/WebCore/svg/SVGPatternElement.cpp

    r118735 r119391  
    243243}
    244244
     245AffineTransform SVGPatternElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope) const
     246{
     247    AffineTransform matrix;
     248    patternTransform().concatenate(matrix);
     249    return matrix;
     250}
     251
    245252bool SVGPatternElement::selfHasRelativeLengths() const
    246253{
  • trunk/Source/WebCore/svg/SVGPatternElement.h

    r117195 r119391  
    5252    void collectPatternAttributes(PatternAttributes&) const;
    5353
     54    virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const;
     55
    5456private:
    5557    SVGPatternElement(const QualifiedName&, Document*);
  • trunk/Source/WebCore/svg/SVGStyledElement.cpp

    r118608 r119391  
    451451AffineTransform SVGStyledElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope) const
    452452{
    453     // To be overriden by SVGStyledLocatableElement/SVGStyledTransformableElement (or as special case SVGTextElement)
     453    // To be overriden by SVGStyledLocatableElement/SVGStyledTransformableElement (or as special case SVGTextElement and SVGPatternElement)
    454454    ASSERT_NOT_REACHED();
    455455    return AffineTransform();
Note: See TracChangeset for help on using the changeset viewer.