Changeset 146515 in webkit


Ignore:
Timestamp:
Mar 21, 2013 1:57:35 PM (11 years ago)
Author:
schenney@chromium.org
Message:

SVG text path referencing parent text infinite loops
https://bugs.webkit.org/show_bug.cgi?id=112078

Reviewed by Philip Rogers.

Source/WebCore:

We do not check the target type when adding a resource reference for
SVG Text Path's URI. This goes horribly wrong when the target is the
text path's parent text element. In this patch we check that the target
element of the text path is indeed a path element, as the spec
requires. No other element type is allowed.

Note that RenderSVGTextPath enforces this check in the renderer code
also, so if we get past this check via pending resources, it doesn't
matter. You can't get into this situation with a pending reference
because, by definition, the parent must be defined before the text
path child.

Test: svg/text/textpath-referencing-text-crash.svg

  • svg/SVGTextPathElement.cpp:

(WebCore::SVGTextPathElement::buildPendingResource):

LayoutTests:

  • svg/text/textpath-referencing-text-crash-expected.txt: Added.
  • svg/text/textpath-referencing-text-crash.svg: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r146510 r146515  
     12013-03-21  Stephen Chenney  <schenney@chromium.org>
     2
     3        SVG text path referencing parent text infinite loops
     4        https://bugs.webkit.org/show_bug.cgi?id=112078
     5
     6        Reviewed by Philip Rogers.
     7
     8        * svg/text/textpath-referencing-text-crash-expected.txt: Added.
     9        * svg/text/textpath-referencing-text-crash.svg: Added.
     10
    1112013-03-21  Philip Rogers  <pdr@google.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r146511 r146515  
     12013-03-21  Stephen Chenney  <schenney@chromium.org>
     2
     3        SVG text path referencing parent text infinite loops
     4        https://bugs.webkit.org/show_bug.cgi?id=112078
     5
     6        Reviewed by Philip Rogers.
     7
     8        We do not check the target type when adding a resource reference for
     9        SVG Text Path's URI. This goes horribly wrong when the target is the
     10        text path's parent text element. In this patch we check that the target
     11        element of the text path is indeed a path element, as the spec
     12        requires. No other element type is allowed.
     13
     14        Note that RenderSVGTextPath enforces this check in the renderer code
     15        also, so if we get past this check via pending resources, it doesn't
     16        matter. You can't get into this situation with a pending reference
     17        because, by definition, the parent must be defined before the text
     18        path child.
     19
     20        Test: svg/text/textpath-referencing-text-crash.svg
     21
     22        * svg/SVGTextPathElement.cpp:
     23        (WebCore::SVGTextPathElement::buildPendingResource):
     24
    1252013-03-21  Joshua Bell  <jsbell@chromium.org>
    226
  • trunk/Source/WebCore/svg/SVGTextPathElement.cpp

    r145377 r146515  
    172172            ASSERT(hasPendingResources());
    173173        }
    174     } else if (target->isSVGElement()) {
     174    } else if (target->hasTagName(SVGNames::pathTag)) {
    175175        // Register us with the target in the dependencies map. Any change of hrefElement
    176176        // that leads to relayout/repainting now informs us, so we can react to it.
Note: See TracChangeset for help on using the changeset viewer.