Changeset 161630 in webkit


Ignore:
Timestamp:
Jan 10, 2014 4:33:09 AM (10 years ago)
Author:
Antti Koivisto
Message:

Crash when mutating SVG text with transform
https://bugs.webkit.org/show_bug.cgi?id=126744

Reviewed by Dirk Schulze.

Source/WebCore:

Test: svg/custom/mutation-text-transform-crash.html

Text-transform property triggers subtreeTextDidChange when an SVG text renderer is
being added to the render tree. The function assumes the child is already fully in the tree
but in this case we are still in middle of adding it.

  • rendering/svg/RenderSVGText.cpp:

(WebCore::RenderSVGText::subtreeTextDidChange):

Bail out if the changed RenderSVGInlineText can't be found from m_layoutAttributes.
This means that subtreeChildWasAdded hasn't been invoked yet for it and there is nothing
to update. The required updates will happen in subtreeChildWasAdded.

LayoutTests:

  • svg/custom/mutation-text-transform-crash-expected.txt: Added.
  • svg/custom/mutation-text-transform-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r161629 r161630  
     12014-01-10  Antti Koivisto  <antti@apple.com>
     2
     3        Crash when mutating SVG text with transform
     4        https://bugs.webkit.org/show_bug.cgi?id=126744
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * svg/custom/mutation-text-transform-crash-expected.txt: Added.
     9        * svg/custom/mutation-text-transform-crash.html: Added.
     10
    1112014-01-10  Frédéric Wang  <fred.wang@free.fr>
    212
  • trunk/Source/WebCore/ChangeLog

    r161629 r161630  
     12014-01-10  Antti Koivisto  <antti@apple.com>
     2
     3        Crash when mutating SVG text with transform
     4        https://bugs.webkit.org/show_bug.cgi?id=126744
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Test: svg/custom/mutation-text-transform-crash.html
     9       
     10        Text-transform property triggers subtreeTextDidChange when an SVG text renderer is
     11        being added to the render tree. The function assumes the child is already fully in the tree
     12        but in this case we are still in middle of adding it.
     13
     14        * rendering/svg/RenderSVGText.cpp:
     15        (WebCore::RenderSVGText::subtreeTextDidChange):
     16       
     17            Bail out if the changed RenderSVGInlineText can't be found from m_layoutAttributes.
     18            This means that subtreeChildWasAdded hasn't been invoked yet for it and there is nothing
     19            to update. The required updates will happen in subtreeChildWasAdded.
     20
    1212014-01-10  Frédéric Wang  <fred.wang@free.fr>
    222
  • trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp

    r161418 r161630  
    322322        return;
    323323    }
     324    // Text transforms can cause text change to be signaled during addChild before m_layoutAttributes has been updated.
     325    if (!m_layoutAttributes.contains(text->layoutAttributes())) {
     326        ASSERT(!text->everHadLayout());
     327        return;
     328    }
    324329
    325330    // Always protect the cache before clearing text positioning elements when the cache will subsequently be rebuilt.
Note: See TracChangeset for help on using the changeset viewer.