Changeset 90166 in webkit


Ignore:
Timestamp:
Jun 30, 2011, 2:51:17 PM (14 years ago)
Author:
jchaffraix@webkit.org
Message:

2011-06-30 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Nikolas Zimmermann.

Update SVG position values on SVG DOM updates
https://bugs.webkit.org/show_bug.cgi?id=62439

  • svg/custom/crash-textPath-attributes-expected.txt: Added.
  • svg/custom/crash-textPath-attributes.html: Added.
  • svg/custom/resources/crash-textPath-attributes-iframe.svg: Added.

2011-06-30 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Nikolas Zimmermann.

Update SVG position values on SVG DOM updates
https://bugs.webkit.org/show_bug.cgi?id=62439

Test: svg/custom/crash-textPath-attributes.html

  • rendering/svg/RenderSVGInline.cpp: (WebCore::RenderSVGInline::destroy): Notify our containing RenderSVGText that it needs to update its positioning information.
  • rendering/svg/SVGInlineFlowBox.cpp: (WebCore::SVGInlineFlowBox::calculateBoundaries): Check the type of the InlineBox like the rest of the code (fixes an ASSERT_NOT_REACHED in InlineBox::calculateBoudaries).
  • rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextSubtree): Clear our cached layout attributes every time we invalidate them. This avoids keeping stale attribute that have a backpointer to a RenderObject.
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90164 r90166  
     12011-06-30  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        Update SVG position values on SVG DOM updates
     6        https://bugs.webkit.org/show_bug.cgi?id=62439
     7
     8        * svg/custom/crash-textPath-attributes-expected.txt: Added.
     9        * svg/custom/crash-textPath-attributes.html: Added.
     10        * svg/custom/resources/crash-textPath-attributes-iframe.svg: Added.
     11
    1122011-06-30  Sreeram Ramachandran  <sreeram@chromium.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r90164 r90166  
     12011-06-30  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        Update SVG position values on SVG DOM updates
     6        https://bugs.webkit.org/show_bug.cgi?id=62439
     7
     8        Test: svg/custom/crash-textPath-attributes.html
     9
     10        * rendering/svg/RenderSVGInline.cpp:
     11        (WebCore::RenderSVGInline::destroy): Notify our containing RenderSVGText that it needs
     12        to update its positioning information.
     13
     14        * rendering/svg/SVGInlineFlowBox.cpp:
     15        (WebCore::SVGInlineFlowBox::calculateBoundaries): Check the type of the InlineBox
     16        like the rest of the code (fixes an ASSERT_NOT_REACHED in InlineBox::calculateBoudaries).
     17
     18        * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
     19        (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextSubtree): Clear
     20        our cached layout attributes every time we invalidate them. This avoids keeping stale
     21        attribute that have a backpointer to a RenderObject.
     22
    1232011-06-30  Sreeram Ramachandran  <sreeram@chromium.org>
    224
  • trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp

    r89754 r90166  
    9696void RenderSVGInline::destroy()
    9797{
     98    if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this))
     99        textRenderer->setNeedsPositioningValuesUpdate();
     100
    98101    SVGResourcesCache::clientDestroyed(this);
    99102    RenderInline::destroy();
  • trunk/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp

    r87753 r90166  
    7676{
    7777    IntRect childRect;
    78     for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
     78    for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
     79        if (!child->isSVGInlineTextBox() && !child->isSVGInlineFlowBox())
     80            continue;
    7981        childRect.unite(child->calculateBoundaries());
     82    }
    8083    return childRect;
    8184}
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp

    r89732 r90166  
    4040    ASSERT(textRoot);
    4141
    42     // Build list of x/y/dx/dy/rotate values for each subtree element that may define these values (tspan/textPath etc).
     42    // We always clear our current attribute as we don't want to keep any stale ones that could survive DOM modification.
     43    Vector<SVGTextLayoutAttributes>& allAttributes = textRoot->layoutAttributes();
     44    allAttributes.clear();
     45
     46     // Build list of x/y/dx/dy/rotate values for each subtree element that may define these values (tspan/textPath etc).
    4347    unsigned atCharacter = 0;
    4448    UChar lastCharacter = '\0';
     
    5256
    5357    // Propagate layout attributes to each RenderSVGInlineText object, and the whole list to the RenderSVGText root.
    54     Vector<SVGTextLayoutAttributes>& allAttributes = textRoot->layoutAttributes();
    55     allAttributes.clear();
    5658    atCharacter = 0;
    5759    lastCharacter = '\0';
Note: See TracChangeset for help on using the changeset viewer.