Changeset 52709 in webkit


Ignore:
Timestamp:
Jan 4, 2010 12:21:52 AM (14 years ago)
Author:
krit@webkit.org
Message:

2010-01-03 Dirk Schulze <krit@webkit.org>

Reviewed by Nikolas Zimmermann.

SVGResources don't invalidate if target object changes attributes
https://bugs.webkit.org/show_bug.cgi?id=33091

It's neccessary to invalidate all resources of an object, if the attributes of this
target change. Otherwise the saved resource data (like ImageBuffers) don't match
to the new object properties.

Test: svg/custom/resource-invalidate-on-target-update.svg

  • svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::svgAttributeChanged): (WebCore::SVGStyledElement::invalidateResources):
  • svg/SVGStyledElement.h:

2010-01-03 Dirk Schulze <krit@webkit.org>

Reviewed by Nikolas Zimmermann.

SVGResources don't invalidate if target object changes attributes
https://bugs.webkit.org/show_bug.cgi?id=33091

Check if SVG resources are invalidated, if target object changes
attributes.

  • platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum: Added.
  • platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png: Added.
  • platform/mac/svg/custom/resource-invalidate-on-target-update-expected.txt: Added.
  • svg/custom/resource-invalidate-on-target-update.svg: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r52700 r52709  
     12010-01-04  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        SVGResources don't invalidate if target object changes attributes
     6        https://bugs.webkit.org/show_bug.cgi?id=33091
     7
     8        Check if SVG resources are invalidated, if target object changes
     9        attributes.
     10
     11        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum: Added.
     12        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png: Added.
     13        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.txt: Added.
     14        * svg/custom/resource-invalidate-on-target-update.svg: Added.
     15
    1162010-01-03  Kenneth Russell  <kbr@google.com>
    217
  • trunk/WebCore/ChangeLog

    r52700 r52709  
     12010-01-04  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        SVGResources don't invalidate if target object changes attributes
     6        https://bugs.webkit.org/show_bug.cgi?id=33091
     7
     8        It's neccessary to invalidate all resources of an object, if the attributes of this
     9        target change. Otherwise the saved resource data (like ImageBuffers) don't match
     10        to the new object properties.
     11
     12        Test: svg/custom/resource-invalidate-on-target-update.svg
     13
     14        * svg/SVGStyledElement.cpp:
     15        (WebCore::SVGStyledElement::svgAttributeChanged):
     16        (WebCore::SVGStyledElement::invalidateResources):
     17        * svg/SVGStyledElement.h:
     18
    1192010-01-03  Kenneth Russell  <kbr@google.com>
    220
  • trunk/WebCore/svg/SVGStyledElement.cpp

    r52580 r52709  
    3737#include "SVGNames.h"
    3838#include "SVGRenderStyle.h"
    39 #include "SVGResource.h"
     39#include "SVGResourceClipper.h"
     40#include "SVGResourceFilter.h"
     41#include "SVGResourceMasker.h"
    4042#include "SVGSVGElement.h"
    4143#include <wtf/Assertions.h>
     
    203205    invalidateResourcesInAncestorChain();
    204206
     207    // If the element is using resources, invalidate them.
     208    invalidateResources();
     209
    205210    // Invalidate all SVGElementInstances associated with us
    206211    SVGElementInstance::invalidateAllInstancesOfElement(this);
     212}
     213
     214void SVGStyledElement::invalidateResources()
     215{
     216    RenderObject* object = renderer();
     217    if (!object)
     218        return;
     219
     220    const SVGRenderStyle* svgStyle = object->style()->svgStyle();
     221    Document* document = this->document();
     222
     223    if (document->parsing())
     224        return;
     225
     226#if ENABLE(FILTERS)
     227    SVGResourceFilter* filter = getFilterById(document, svgStyle->filter(), object);
     228    if (filter)
     229        filter->invalidate();
     230#endif
     231
     232    SVGResourceMasker* masker = getMaskerById(document, svgStyle->maskElement(), object);
     233    if (masker)
     234        masker->invalidate();
     235
     236    SVGResourceClipper* clipper = getClipperById(document, svgStyle->clipPath(), object);
     237    if (clipper)
     238        clipper->invalidate();
    207239}
    208240
  • trunk/WebCore/svg/SVGStyledElement.h

    r52580 r52709  
    6161        PassRefPtr<RenderStyle> resolveStyle(RenderStyle* parentStyle);
    6262
    63         void invalidateResourcesInAncestorChain() const;       
     63        void invalidateResourcesInAncestorChain() const;
     64        void invalidateResources();
     65
    6466        virtual void detach();
    6567                                 
Note: See TracChangeset for help on using the changeset viewer.