⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249026 in webkit


Ignore:
Timestamp:
Aug 22, 2019, 2:13:38 PM (7 years ago)
Author:
Said Abou-Hallawa
Message:

Crash may happen when an SVG <feImage> element references the root <svg> element
https://bugs.webkit.org/show_bug.cgi?id=201014

Reviewed by Ryosuke Niwa.

Source/WebCore:

When an <feImage> references an <svg> element as its target image but
this <svg> element is also one of the ancestors of the <feImage>, the
parent <filter> should not be applied.

Test: svg/filters/filter-image-ref-root.html

  • svg/SVGFEImageElement.cpp:

(WebCore::SVGFEImageElement::build const):

LayoutTests:

Ensure the cyclic reference between the <feImage> renderer and its
ancestor <svg> root renderer is broken.

  • svg/filters/filter-image-ref-root-expected.txt: Added.
  • svg/filters/filter-image-ref-root.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249017 r249026  
     12019-08-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Crash may happen when an SVG <feImage> element references the root <svg> element
     4        https://bugs.webkit.org/show_bug.cgi?id=201014
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Ensure the cyclic reference between the <feImage> renderer and its
     9        ancestor <svg> root renderer is broken.
     10
     11        * svg/filters/filter-image-ref-root-expected.txt: Added.
     12        * svg/filters/filter-image-ref-root.html: Added.
     13
    1142019-08-22  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r249025 r249026  
     12019-08-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Crash may happen when an SVG <feImage> element references the root <svg> element
     4        https://bugs.webkit.org/show_bug.cgi?id=201014
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        When an <feImage> references an <svg> element as its target image but
     9        this <svg> element is also one of the ancestors of the <feImage>, the
     10        parent <filter> should not be applied.
     11
     12        Test: svg/filters/filter-image-ref-root.html
     13
     14        * svg/SVGFEImageElement.cpp:
     15        (WebCore::SVGFEImageElement::build const):
     16
    1172019-08-22  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Source/WebCore/svg/SVGFEImageElement.cpp

    r246490 r249026  
    186186    if (m_cachedImage)
    187187        return FEImage::createWithImage(filter, m_cachedImage->imageForRenderer(renderer()), preserveAspectRatio());
     188
     189    auto target = SVGURIReference::targetElementFromIRIString(href(), treeScope());
     190    if (isDescendantOrShadowDescendantOf(target.element.get()))
     191        return nullptr;
     192
    188193    return FEImage::createWithIRIReference(filter, treeScope(), href(), preserveAspectRatio());
    189194}
Note: See TracChangeset for help on using the changeset viewer.