Changeset 64275 in webkit


Ignore:
Timestamp:
Jul 29, 2010 6:50:51 AM (14 years ago)
Author:
Nikolas Zimmermann
Message:

2010-07-29 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Dirk Schulze.

WebKit shouldn't ignore resource cycles, but break them as Opera does
https://bugs.webkit.org/show_bug.cgi?id=43031

mask images are not updated when render objects' bounds change
https://bugs.webkit.org/show_bug.cgi?id=15124

SVG Gradients do not resize correctly
https://bugs.webkit.org/show_bug.cgi?id=41902

svg/dynamic-updates: SVGMarkerElement markerHeight/Width tests are broken
https://bugs.webkit.org/show_bug.cgi?id=42616

svg/dynamic-updates: SVGMaskElement tests are all broken
https://bugs.webkit.org/show_bug.cgi?id=42617

Don't ignore resources containing cyclic references, but break them, as discussed on SVG WG mailing lists - to be compatible with Opera which already does that.

We used to lookup RenderSVGResourceContainers objects, by extracting the URI reference from the SVGRenderStyle, then utilizing getElementById() to lookup the
node, and access its renderer. Opera ignores such references, if they point to resources that contain cyclic references. Ignoring them would mean we have
to mutate the render style to empty the resource strings. That obviously doesn't work, as it would break expectations (getComputedStyle, etc.).

Introduce a SVGResources class that stores pointers to all resources, that can be applied to a RenderObject (clipper/filter/markers/masker).
Add a SVGResourcesCache class, which is basically a HashMap<RenderObject*, SVGResources*>. Whenever a RenderObject receives style, we extract the URI references
from the SVGRenderStyle, look up the RenderSVGResourceContainer* objects, and store them in a SVGResources* class. Then we execute a cycle detection logic,
which detects cyclic references and breaks them. Breaking them means just nulling the pointer to the resource in the SVGResources object. Those SVGResources
objects are cached, and used throughout the render tree to access resources. This way it's guaranteed that all cyclic references are resolved until layout/paint
phase begins.

Add destroy/styleDidChange/updateFromElement methods to all SVG renderers, in order to keep track of resource/client changes in the SVGResourcesCache.
As side-effect the SVGResourcesCache now knows which RenderObject references which resource, and thus can handle client registration for a RenderSVGResourceContainer.
The RenderSVGResourceContainer now holds a HashSet of RenderObjects, that's always up2date, and not related to the fact wheter a resources has already been used
for painting. The old logic missed to register clients for a resource, when the resource was in an invalid state. Fixing that fixes the svg/dynamic-updates/SVGMaskElement* tests.

Rewrite all svg/custom/recursive-(filter|gradient|mask|pattern).svg tests to contain a reference image how it should be renderered. All 1:1 compatible with Opera now.

  • rendering/RenderForeignObject.cpp: (WebCore::RenderForeignObject::layout): Grab selfNeedsLayout() before calling RenderBlock::layout(), otherwhise it's always false.
  • rendering/RenderPath.cpp: Don't look up resources manually, use SVGResourcesCache. (WebCore::RenderPath::fillContains): Remove constness, to avoid the need to pass around const RenderObjects* to the SVGResourcesCache. (WebCore::RenderPath::strokeContains): Ditto. (WebCore::RenderPath::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/. (WebCore::RenderPath::calculateMarkerBoundsIfNeeded): Remove special client handling for markers, it's all unified now. (WebCore::RenderPath::styleWillChange): Only call setNeedsBoundariesUpdate when handling StyleDifferenceRepaint/Layout.
  • rendering/RenderPath.h:
  • rendering/RenderSVGBlock.cpp: (WebCore::RenderSVGBlock::destroy): Forward to SVGResourcesCache::clientDestroyed. (WebCore::RenderSVGBlock::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged. (WebCore::RenderSVGBlock::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
  • rendering/RenderSVGBlock.h:
  • rendering/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/. (WebCore::RenderSVGContainer::selfWillPaint): Don't look up resources manually, use SVGResourcesCache.
  • rendering/RenderSVGContainer.h:
  • rendering/RenderSVGGradientStop.cpp: (WebCore::RenderSVGGradientStop::styleDidChange): Rewrite, as invalidateResourceClients() is gone.
  • rendering/RenderSVGHiddenContainer.h: Make layout() protected, as RenderSVGResourceContainer overrides it.
  • rendering/RenderSVGImage.cpp: (WebCore::RenderSVGImage::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/. (WebCore::RenderSVGImage::destroy): Forward to SVGResourcesCache::clientDestroyed. (WebCore::RenderSVGImage::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged. (WebCore::RenderSVGImage::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement. (WebCore::RenderSVGImage::imageChanged): Don't look up resources manually, use SVGResourcesCache.
  • rendering/RenderSVGImage.h:
  • rendering/RenderSVGInline.cpp: (WebCore::RenderSVGInline::destroy): Forward to SVGResourcesCache::clientDestroyed. (WebCore::RenderSVGInline::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged. (WebCore::RenderSVGInline::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
  • rendering/RenderSVGInline.h:
  • rendering/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::destroy): Forward to SVGResourcesCache::clientDestroyed. (WebCore::RenderSVGModelObject::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged. (WebCore::RenderSVGModelObject::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
  • rendering/RenderSVGModelObject.h:
  • rendering/RenderSVGResource.cpp: (WebCore::RenderSVGResource::fillPaintingResource): Remove const from RenderObject parameter. (WebCore::RenderSVGResource::strokePaintingResource): Ditto. (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation): Early exit if we found the first parent resource.
  • rendering/RenderSVGResource.h:
  • rendering/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::~RenderSVGResourceClipper): Early exit if m_clipper is empty. (WebCore::RenderSVGResourceClipper::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer. (WebCore::RenderSVGResourceClipper::invalidateClient): Ditto. (WebCore::RenderSVGResourceClipper::applyResource): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore. (WebCore::RenderSVGResourceClipper::createClipData): Don't look up resources manually, use SVGResourcesCache. (WebCore::RenderSVGResourceClipper::hitTestClipContent): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore.
  • rendering/RenderSVGResourceClipper.h:
  • rendering/RenderSVGResourceContainer.cpp: (WebCore::svgExtensionsFromNode): (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer): Stop registering resource from the constructor, delegate to styleDidChange. (WebCore::RenderSVGResourceContainer::~RenderSVGResourceContainer): Only deregister resource if it was ever registered. (WebCore::RenderSVGResourceContainer::layout): invalidateClients() here, to avoid the need for invalidateResourceClients() in the SVG DOM. Just call setNeedsLayout() from the SVG DOM. (WebCore::RenderSVGResourceContainer::destroy): Forward to SVGResourcesCache::resourceDestroyed. (WebCore::RenderSVGResourceContainer::styleDidChange): Register resource not in the constructor but when it first receives style. (WebCore::RenderSVGResourceContainer::idChanged): Don't duplicate code, use existing methods from SVGResourcesCache. (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation): Add new helper function, to share code between all resources. (WebCore::RenderSVGResourceContainer::markClientForInvalidation): Ditto. (WebCore::RenderSVGResourceContainer::addClient): SVGResourcesCache now manages the list of clients. It calls addClient() for each RenderObject that uses this resource. (WebCore::RenderSVGResourceContainer::removeClient): SVGResourcesCache now manages the list of clients. (WebCore::RenderSVGResourceContainer::registerResource): New helper function sharing code between idChanged / styleDidChange. (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke): Add FIXME that the function is misplaced.
  • rendering/RenderSVGResourceContainer.h: Move most functions to the new RenderSVGResourceContainer.cpp file.
  • rendering/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::~RenderSVGResourceFilter): Early exit if m_filter is empty. (WebCore::RenderSVGResourceFilter::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer. (WebCore::RenderSVGResourceFilter::invalidateClient): Ditto.
  • rendering/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::~RenderSVGResourceGradient): Early exit if m_gradient is empty. (WebCore::RenderSVGResourceGradient::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer. (WebCore::RenderSVGResourceGradient::invalidateClient): Ditto.
  • rendering/RenderSVGResourceMarker.cpp: (WebCore::RenderSVGResourceMarker::~RenderSVGResourceMarker): Now a no-op, markers are unified within the new client handling concept, no more special code needed. (WebCore::RenderSVGResourceMarker::layout): As RenderSVGResourceMarker skips the RenderSVGResourceContainer::layout() method, we also need to call invalidateClients() here. (WebCore::RenderSVGResourceMarker::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer. (WebCore::RenderSVGResourceMarker::invalidateClient): Ditto. (WebCore::RenderSVGResourceMarker::draw): Remove marker specific logic to catch circular references.
  • rendering/RenderSVGResourceMarker.h:
  • rendering/RenderSVGResourceMasker.cpp: (WebCore::RenderSVGResourceMasker::~RenderSVGResourceMasker): Early exit if m_masker is empty. (WebCore::RenderSVGResourceMasker::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer. (WebCore::RenderSVGResourceMasker::invalidateClient): Ditto. (WebCore::RenderSVGResourceMasker::applyResource): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore.
  • rendering/RenderSVGResourceMasker.h:
  • rendering/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::~RenderSVGResourcePattern): Early exit if m_pattern is empty. (WebCore::RenderSVGResourcePattern::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer. (WebCore::RenderSVGResourcePattern::invalidateClient): Ditto. (WebCore::RenderSVGResourcePattern::createTileImage): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore.
  • rendering/RenderSVGResourcePattern.h:
  • rendering/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::selfWillPaint): Don't look up resources manually, use SVGResourcesCache. (WebCore::RenderSVGRoot::destroy): Forward to SVGResourcesCache::clientDestroyed. (WebCore::RenderSVGRoot::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged. (WebCore::RenderSVGRoot::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
  • rendering/RenderSVGRoot.h:
  • rendering/RenderSVGText.cpp: (WebCore::RenderSVGText::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/.
  • rendering/RenderSVGText.h:
  • rendering/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::acquirePaintingResource): Add RenderObject* parameter, don't assume the style comes from the InlineTextBox parent renderer. (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting): Pass the parent()->renderer() to acquirePaintingResource. (WebCore::SVGInlineTextBox::paintDecoration): Pass the decoration renderer to acquirePaintingResource. (WebCore::SVGInlineTextBox::paintDecorationWithStyle): Ditto. (WebCore::SVGInlineTextBox::paintText): When a selection pseudo style is used to paint the selection, swap styles in the SVGResourcesCache, to take the right resources when painting.
  • rendering/SVGInlineTextBox.h:
  • rendering/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::prepareToRenderSVGContent): Don't look up resources manually, use SVGResourcesCache. (WebCore::SVGRenderSupport::finishRenderSVGContent): Ditto. (WebCore::SVGRenderSupport::intersectRepaintRectWithResources): Ditto. (WebCore::SVGRenderSupport::pointInClippingArea): Remove const from RenderObject parameter.
  • rendering/SVGRenderSupport.h:
  • rendering/SVGRenderTreeAsText.cpp: (WebCore::writeStyle): Add two const_cast now that fill/strokePaintingResource take RenderObject* parameters. This was the less intrusive approach, otherwhise more const_casts would be needed. (WebCore::writeResources): Add FIXME that we should dump the resources present in the SVGResourcesCache instead of manually looking them up from the SVGRenderStyle, to avoid dumping cycles.
  • rendering/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::clientStyleChanged): Use markForLayoutAndParentResourceInvalidation() instead of duplicating code.
  • rendering/SVGResourcesCycleSolver.cpp: (WebCore::setFollowLinkForChainableResource): Implemented stub method.
  • rendering/style/SVGRenderStyle.cpp: (WebCore::SVGRenderStyle::diff): Return StyleDifferenceLayout, not Repaint for stroke paint changes, otherwhise the cached boundaries are not correctly updated.
  • svg/SVGClipPathElement.cpp: (WebCore::SVGClipPathElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGClipPathElement::childrenChanged): Ditto.
  • svg/SVGClipPathElement.h: (WebCore::SVGClipPathElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
  • svg/SVGElement.cpp: (WebCore::SVGElement::insertedIntoDocument): Only execute buildPendingResource() logic, if needsPendingResourceHandling() returns true. Cleaned up code a bit, to deploy early returns.
  • svg/SVGElement.h: (WebCore::SVGElement::needsPendingResourceHandling): Return true (default). Only needed by SVGTextPathElement/SVGUseElement, and should be removed in future.
  • svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::SVGFilterElement): Initialize m_followLink=true. (WebCore::SVGFilterElement::setFilterRes): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGFilterElement::svgAttributeChanged): Ditto. (WebCore::SVGFilterElement::childrenChanged): Ditto.
  • svg/SVGFilterElement.h: (WebCore::SVGFilterElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer. (WebCore::SVGFilterElement::setFollowLink): Used by SVGResourcesCycleSolver, to stop following xlink:href links, if that leads to cyclic references.
  • svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged): Don't use invalidateResourceClients(), it's a no-op as effects don't have a renderer -> use invalidateFilter().
  • svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::invalidateFilter): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
  • svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::SVGGradientElement): Initialize m_followLink=true. (WebCore::SVGGradientElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGGradientElement::childrenChanged): Ditto.
  • svg/SVGGradientElement.h: (WebCore::SVGGradientElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer. (WebCore::SVGGradientElement::setFollowLink): Used by SVGResourcesCycleSolver, to stop following xlink:href links, if that leads to cyclic references.
  • svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGLinearGradientElement::collectGradientProperties): Only follow xlink:href links if m_followLinks == true.
  • svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGMarkerElement::childrenChanged): Ditto. (WebCore::SVGMarkerElement::setOrientToAuto): Ditto. (WebCore::SVGMarkerElement::setOrientToAngle): Ditto.
  • svg/SVGMarkerElement.h: (WebCore::SVGMarkerElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
  • svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGMaskElement::childrenChanged): Ditto.
  • svg/SVGMaskElement.h: (WebCore::SVGMaskElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
  • svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::SVGPatternElement): Initialize m_followLink=true. (WebCore::SVGPatternElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGPatternElement::childrenChanged): Ditto. (WebCore::SVGPatternElement::collectPatternProperties): Only follow xlink:href links if m_followLinks == true.
  • svg/SVGPatternElement.h: (WebCore::SVGPatternElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer. (WebCore::SVGPatternElement::setFollowLink): Used by SVGResourcesCycleSolver, to stop following xlink:href links, if that leads to cyclic references.
  • svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer. (WebCore::SVGRadialGradientElement::collectGradientProperties): Only follow xlink:href links if m_followLinks == true.
  • svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::attach): Call updateFromElement upon attach(), needed by all resource renderers. Defaults to a no-op in RenderObject.h
  • svg/SVGStyledElement.h: Remove invalidateResourceClients(), it's not needed anymore.

2010-07-29 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Dirk Schulze.

WebKit shouldn't ignore resource cycles, but break them as Opera does
https://bugs.webkit.org/show_bug.cgi?id=43031

Rebaseline results now that cycles are broken, instead of ignored.

  • platform/mac/svg/clip-path/clip-path-recursive-call-by-child-expected.txt:
  • platform/mac/svg/clip-path/clip-path-recursive-call-expected.checksum:
  • platform/mac/svg/clip-path/clip-path-recursive-call-expected.png:
  • platform/mac/svg/custom/circular-marker-reference-4-expected.txt:
  • platform/mac/svg/custom/gradient-cycle-detection-expected.checksum:
  • platform/mac/svg/custom/gradient-cycle-detection-expected.png:
  • platform/mac/svg/custom/recursive-clippath-expected.checksum:
  • platform/mac/svg/custom/recursive-clippath-expected.png:
  • platform/mac/svg/custom/recursive-clippath-expected.txt:
  • platform/mac/svg/custom/recursive-filter-expected.checksum:
  • platform/mac/svg/custom/recursive-filter-expected.png:
  • platform/mac/svg/custom/recursive-filter-expected.txt:
  • platform/mac/svg/custom/recursive-gradient-expected.checksum:
  • platform/mac/svg/custom/recursive-gradient-expected.png:
  • platform/mac/svg/custom/recursive-gradient-expected.txt:
  • platform/mac/svg/custom/recursive-mask-expected.checksum:
  • platform/mac/svg/custom/recursive-mask-expected.png:
  • platform/mac/svg/custom/recursive-mask-expected.txt:
  • platform/mac/svg/custom/recursive-pattern-expected.checksum:
  • platform/mac/svg/custom/recursive-pattern-expected.png:
  • platform/mac/svg/custom/recursive-pattern-expected.txt:
  • platform/mac/svg/custom/use-events-crash-expected.txt:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerHeight-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerHeight-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerWidth-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerWidth-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerHeight-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerHeight-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerWidth-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerWidth-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskUnits-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskUnits-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskUnits-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskUnits-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png:
  • platform/mac/svg/hixie/error/017-expected.txt:
  • svg/clip-path/clip-path-recursive-call-by-child.svg: Rewrite test to match expectations, now that cycles are broken, not ignored. Looks like in Opera.
  • svg/custom/js-late-clipPath-and-object-creation.svg: Don't update from within the onload event, instead use zero-ms timeouts, to test updating reliable. It failed before this patch.
  • svg/custom/js-late-clipPath-creation.svg: Ditto.
  • svg/custom/js-late-gradient-and-object-creation.svg: Ditto.
  • svg/custom/js-late-gradient-creation.svg: Ditto.
  • svg/custom/js-late-marker-and-object-creation.svg: Ditto.
  • svg/custom/js-late-marker-creation.svg: Ditto.
  • svg/custom/js-late-mask-and-object-creation.svg: Ditto.
  • svg/custom/js-late-mask-creation.svg: Ditto.
  • svg/custom/js-late-pattern-and-object-creation.svg: Ditto.
  • svg/custom/js-late-pattern-creation.svg: Ditto.
  • svg/custom/recursive-clippath.svg: Add a reference rendering, side by side to the test, for the ease of comparision. Passes in WebKit + Opera.
  • svg/custom/recursive-filter.svg: Ditto.
  • svg/custom/recursive-gradient.svg: Ditto.
  • svg/custom/recursive-mask.svg: Ditto.
  • svg/custom/recursive-pattern.svg: Ditto.
Location:
trunk
Files:
134 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64272 r64275  
     12010-07-29  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        WebKit shouldn't ignore resource cycles, but break them as Opera does
     6        https://bugs.webkit.org/show_bug.cgi?id=43031
     7
     8        Rebaseline results now that cycles are broken, instead of ignored.
     9
     10        * platform/mac/svg/clip-path/clip-path-recursive-call-by-child-expected.txt:
     11        * platform/mac/svg/clip-path/clip-path-recursive-call-expected.checksum:
     12        * platform/mac/svg/clip-path/clip-path-recursive-call-expected.png:
     13        * platform/mac/svg/custom/circular-marker-reference-4-expected.txt:
     14        * platform/mac/svg/custom/gradient-cycle-detection-expected.checksum:
     15        * platform/mac/svg/custom/gradient-cycle-detection-expected.png:
     16        * platform/mac/svg/custom/recursive-clippath-expected.checksum:
     17        * platform/mac/svg/custom/recursive-clippath-expected.png:
     18        * platform/mac/svg/custom/recursive-clippath-expected.txt:
     19        * platform/mac/svg/custom/recursive-filter-expected.checksum:
     20        * platform/mac/svg/custom/recursive-filter-expected.png:
     21        * platform/mac/svg/custom/recursive-filter-expected.txt:
     22        * platform/mac/svg/custom/recursive-gradient-expected.checksum:
     23        * platform/mac/svg/custom/recursive-gradient-expected.png:
     24        * platform/mac/svg/custom/recursive-gradient-expected.txt:
     25        * platform/mac/svg/custom/recursive-mask-expected.checksum:
     26        * platform/mac/svg/custom/recursive-mask-expected.png:
     27        * platform/mac/svg/custom/recursive-mask-expected.txt:
     28        * platform/mac/svg/custom/recursive-pattern-expected.checksum:
     29        * platform/mac/svg/custom/recursive-pattern-expected.png:
     30        * platform/mac/svg/custom/recursive-pattern-expected.txt:
     31        * platform/mac/svg/custom/use-events-crash-expected.txt:
     32        * platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerHeight-attr-expected.checksum:
     33        * platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerHeight-attr-expected.png:
     34        * platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerWidth-attr-expected.checksum:
     35        * platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerWidth-attr-expected.png:
     36        * platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerHeight-prop-expected.checksum:
     37        * platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerHeight-prop-expected.png:
     38        * platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerWidth-prop-expected.checksum:
     39        * platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerWidth-prop-expected.png:
     40        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum:
     41        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png:
     42        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum:
     43        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png:
     44        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskUnits-attr-expected.checksum:
     45        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskUnits-attr-expected.png:
     46        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum:
     47        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png:
     48        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum:
     49        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png:
     50        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum:
     51        * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png:
     52        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum:
     53        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png:
     54        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum:
     55        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png:
     56        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskUnits-prop-expected.checksum:
     57        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskUnits-prop-expected.png:
     58        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum:
     59        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png:
     60        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum:
     61        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png:
     62        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum:
     63        * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png:
     64        * platform/mac/svg/hixie/error/017-expected.txt:
     65        * svg/clip-path/clip-path-recursive-call-by-child.svg: Rewrite test to match expectations, now that cycles are broken, not ignored. Looks like in Opera.
     66        * svg/custom/js-late-clipPath-and-object-creation.svg: Don't update from within the onload event, instead use zero-ms timeouts, to test updating reliable. It failed before this patch.
     67        * svg/custom/js-late-clipPath-creation.svg: Ditto.
     68        * svg/custom/js-late-gradient-and-object-creation.svg: Ditto.
     69        * svg/custom/js-late-gradient-creation.svg: Ditto.
     70        * svg/custom/js-late-marker-and-object-creation.svg: Ditto.
     71        * svg/custom/js-late-marker-creation.svg: Ditto.
     72        * svg/custom/js-late-mask-and-object-creation.svg: Ditto.
     73        * svg/custom/js-late-mask-creation.svg: Ditto.
     74        * svg/custom/js-late-pattern-and-object-creation.svg: Ditto.
     75        * svg/custom/js-late-pattern-creation.svg: Ditto.
     76        * svg/custom/recursive-clippath.svg: Add a reference rendering, side by side to the test, for the ease of comparision. Passes in WebKit + Opera.
     77        * svg/custom/recursive-filter.svg: Ditto.
     78        * svg/custom/recursive-gradient.svg: Ditto.
     79        * svg/custom/recursive-mask.svg: Ditto.
     80        * svg/custom/recursive-pattern.svg: Ditto.
     81
    1822010-07-21 Antonio Gomes  <tonikitoo@webkit.org> , Grace Kloba  <klobag@gmail.com>
    283
  • trunk/LayoutTests/platform/mac/svg/clip-path/clip-path-recursive-call-by-child-expected.txt

    r63420 r64275  
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    66      RenderSVGResourceClipper {clipPath} [id="clip"] [clipPathUnits=userSpaceOnUse]
    7         RenderPath {rect} at (0,0) size 100x50 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,50.00 L0.00,50.00 Z"]
    8           [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x50
     7        RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
     8          [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100
    99    RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    10     RenderPath {rect} at (0,0) size 100x50 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    11       [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x50
     10    RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
     11      [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100
  • trunk/LayoutTests/platform/mac/svg/clip-path/clip-path-recursive-call-expected.checksum

    r57511 r64275  
    1 853de00567d121bea0b7bece66a5d61c
     1778803df0a824ed8f2c7dfa07c56832e
  • trunk/LayoutTests/platform/mac/svg/custom/circular-marker-reference-4-expected.txt

    r62922 r64275  
    66      RenderPath {path} at (310,240) size 180x60 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark2] [middle marker=mark2] [end marker=mark2] [data="M-5.00,-2.00 L0.00,-2.00 L5.00,-2.00"]
    77    RenderSVGResourceMarker {marker} [id="mark2"] [markerUnits=strokeWidth] [ref at (4,4)] [angle=0.00]
    8       RenderPath {path} at (280,270) size 210x90 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark1] [middle marker=mark1] [end marker=mark1] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
     8      RenderPath {path} at (310,300) size 180x60 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark1] [middle marker=mark1] [end marker=mark1] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
    99    RenderPath {path} at (130,270) size 450x120 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=mark1] [middle marker=mark1] [end marker=mark1] [data="M-5.00,2.00 L0.00,2.00 L5.00,2.00"]
  • trunk/LayoutTests/platform/mac/svg/custom/gradient-cycle-detection-expected.checksum

    r38008 r64275  
    1 c31435453e4b5fe90b3b618f35608ef3
     1a7754e874db94ad931cb2db1054e361f
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-clippath-expected.checksum

    r63421 r64275  
    1 67516477d9f265bd907635bbade318cd
     172e669ce7be88c04c721d627b566c3cb
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-clippath-expected.txt

    r63421 r64275  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (0,0) size 200x300
     4  RenderSVGRoot {svg} at (29,0) size 292x304
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    66      RenderSVGResourceClipper {clipPath} [id="clipPath_0"] [clipPathUnits=userSpaceOnUse]
    7         RenderPath {rect} at (0,0) size 100x100 [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    8           [clipPath="clipPath_0"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100
    9       RenderPath {rect} at (0,100) size 100x100 [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
    10         [clipPath="clipPath_1"] RenderSVGResourceClipper {clipPath} at (0,100) size 100x100
     7        RenderPath {rect} at (50,0) size 50x50 [data="M50.00,0.00 L100.00,0.00 L100.00,50.00 L50.00,50.00 Z"]
     8          [clipPath="clipPath_0"] RenderSVGResourceClipper {clipPath} at (50,0) size 50x50
     9      RenderPath {rect} at (50,150) size 50x50 [data="M50.00,150.00 L100.00,150.00 L100.00,200.00 L50.00,200.00 Z"]
     10        [clipPath="clipPath_1"] RenderSVGResourceClipper {clipPath} at (50,150) size 50x50
    1111      RenderSVGResourceClipper {clipPath} [id="clipPath_1"] [clipPathUnits=userSpaceOnUse]
    12         RenderSVGContainer {use} at (0,100) size 100x100
    13           RenderSVGContainer {g} at (0,100) size 100x100
    14             RenderPath {rect} at (0,100) size 100x100 [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
    15               [clipPath="clipPath_1"] RenderSVGResourceClipper {clipPath} at (0,100) size 100x100
    16     RenderPath {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"]
    17     RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"]
    18       [clipPath="clipPath_0"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100
    19     RenderPath {rect} at (0,100) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,100.00 L200.00,100.00 L200.00,300.00 L0.00,300.00 Z"]
    20     RenderPath {rect} at (0,100) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,100.00 L200.00,100.00 L200.00,300.00 L0.00,300.00 Z"]
    21       [clipPath="clipPath_1"] RenderSVGResourceClipper {clipPath} at (0,100) size 100x100
     12        RenderSVGContainer {use} at (50,150) size 50x50
     13          RenderSVGContainer {g} at (50,150) size 50x50
     14            RenderPath {rect} at (50,150) size 50x50 [data="M50.00,150.00 L100.00,150.00 L100.00,200.00 L50.00,200.00 Z"]
     15              [clipPath="clipPath_1"] RenderSVGResourceClipper {clipPath} at (50,150) size 50x50
     16    RenderPath {rect} at (50,0) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [data="M50.00,0.00 L150.00,0.00 L150.00,100.00 L50.00,100.00 Z"]
     17    RenderPath {rect} at (50,0) size 50x50 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,0.00 L150.00,0.00 L150.00,100.00 L50.00,100.00 Z"]
     18      [clipPath="clipPath_0"] RenderSVGResourceClipper {clipPath} at (50,0) size 50x50
     19    RenderPath {rect} at (50,150) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [data="M50.00,150.00 L150.00,150.00 L150.00,250.00 L50.00,250.00 Z"]
     20    RenderPath {rect} at (50,150) size 50x50 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,150.00 L150.00,150.00 L150.00,250.00 L50.00,250.00 Z"]
     21      [clipPath="clipPath_1"] RenderSVGResourceClipper {clipPath} at (50,150) size 50x50
     22    RenderPath {line} at (174,0) size 2x250 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#000000]}] [data="M175.00,0.00 L175.00,250.00"]
     23    RenderSVGText {text} at (29,286) size 292x18 contains 1 chunk(s)
     24      RenderSVGInlineText {#text} at (0,0) size 292x18
     25        chunk 1 (middle anchor) text run 1 at (29.00,300.00) startOffset 0 endOffset 48 width 292.00: "Both sides of the red line should look identical"
     26    RenderSVGContainer {g} at (200,0) size 100x250 [transform={m=((1.00,0.00)(0.00,1.00)) t=(150.00,0.00)}]
     27      RenderPath {rect} at (200,0) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [data="M50.00,0.00 L150.00,0.00 L150.00,100.00 L50.00,100.00 Z"]
     28      RenderPath {rect} at (200,0) size 50x50 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,0.00 L100.00,0.00 L100.00,50.00 L50.00,50.00 Z"]
     29      RenderPath {rect} at (200,150) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [data="M50.00,150.00 L150.00,150.00 L150.00,250.00 L50.00,250.00 Z"]
     30      RenderPath {rect} at (200,150) size 50x50 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,150.00 L100.00,150.00 L100.00,200.00 L50.00,200.00 Z"]
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-filter-expected.checksum

    r63300 r64275  
    1 dda4f1b67cf9fb2058815ce9466326fc
     10e4859e3b02f2f48bba2c68cad4e0e7b
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-filter-expected.txt

    r63300 r64275  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (0,0) size 111x210
     4  RenderSVGRoot {svg} at (29,0) size 292x304
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
     6      RenderSVGResourceFilter {filter} [id="filter0"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
     7        [feGaussianBlur stdDeviation="4.00, 4.00"]
     8          [SourceGraphic]
    69      RenderSVGResourceFilter {filter} [id="filter1"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    710        [feGaussianBlur stdDeviation="4.00, 4.00"]
    811          [SourceGraphic]
    912      RenderSVGResourceFilter {filter} [id="filter2"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    10     RenderPath {rect} at (0,0) size 111x111 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    11       [filter="filter1"] RenderSVGResourceFilter {filter} at (-10,-10) size 120x120
    12     RenderPath {rect} at (0,90) size 111x120 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
    13       [filter="filter2"] RenderSVGResourceFilter {filter} at (-10,90) size 120x120
     13    RenderPath {rect} at (40,0) size 120x111 [fill={[type=SOLID] [color=#0000FF]}] [data="M50.00,0.00 L150.00,0.00 L150.00,100.00 L50.00,100.00 Z"]
     14      [filter="filter1"] RenderSVGResourceFilter {filter} at (40,-10) size 120x120
     15    RenderPath {rect} at (40,140) size 120x120 [fill={[type=SOLID] [color=#0000FF]}] [data="M50.00,150.00 L150.00,150.00 L150.00,250.00 L50.00,250.00 Z"]
     16      [filter="filter2"] RenderSVGResourceFilter {filter} at (40,140) size 120x120
     17    RenderPath {line} at (174,0) size 2x250 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#000000]}] [data="M175.00,0.00 L175.00,250.00"]
     18    RenderSVGText {text} at (29,286) size 292x18 contains 1 chunk(s)
     19      RenderSVGInlineText {#text} at (0,0) size 292x18
     20        chunk 1 (middle anchor) text run 1 at (29.00,300.00) startOffset 0 endOffset 48 width 292.00: "Both sides of the red line should look identical"
     21    RenderSVGContainer {g} at (190,0) size 120x111 [transform={m=((1.00,0.00)(0.00,1.00)) t=(150.00,0.00)}]
     22      RenderPath {rect} at (190,0) size 120x111 [fill={[type=SOLID] [color=#0000FF]}] [data="M50.00,0.00 L150.00,0.00 L150.00,100.00 L50.00,100.00 Z"]
     23        [filter="filter0"] RenderSVGResourceFilter {filter} at (40,-10) size 120x120
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-gradient-expected.checksum

    r63416 r64275  
    1 efd46e2c198be8ead9a8d0392dbc1e94
     12e73268fd422007888f75dd8c8ba6490
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-gradient-expected.txt

    r63416 r64275  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (0,0) size 201x201
     4  RenderSVGRoot {svg} at (0,0) size 451x254
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    6       RenderSVGResourceRadialGradient {radialGradient} [id="gradient1"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.15,0.15)] [radius=0.50]
     6      RenderSVGResourceRadialGradient {radialGradient} [id="gradient0"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50]
    77        RenderSVGGradientStop {stop} [offset=0.00] [color=#0000FF]
    88        RenderSVGGradientStop {stop} [offset=1.00] [color=#FF0000]
    9       RenderSVGResourceRadialGradient {radialGradient} [id="gradient2"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.15,0.15)] [radius=0.50]
    10       RenderSVGResourceRadialGradient {radialGradient} [id="gradient3"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.15,0.15)] [radius=0.50]
     9      RenderSVGResourceRadialGradient {radialGradient} [id="gradient1"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50]
     10        RenderSVGGradientStop {stop} [offset=0.00] [color=#0000FF]
     11        RenderSVGGradientStop {stop} [offset=1.00] [color=#FF0000]
     12      RenderSVGResourceRadialGradient {radialGradient} [id="gradient2"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50]
     13      RenderSVGResourceRadialGradient {radialGradient} [id="gradient4"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50]
     14      RenderSVGResourceRadialGradient {radialGradient} [id="gradient3"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50]
    1115    RenderPath {rect} at (0,0) size 101x101 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=RADIAL-GRADIENT] [id="gradient1"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    1216    RenderPath {rect} at (99,0) size 102x101 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=RADIAL-GRADIENT] [id="gradient2"]}] [data="M100.00,0.00 L200.00,0.00 L200.00,100.00 L100.00,100.00 Z"]
    1317    RenderPath {rect} at (0,99) size 101x102 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=RADIAL-GRADIENT] [id="gradient3"]}] [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
     18    RenderPath {line} at (224,0) size 2x200 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#000000]}] [data="M225.00,0.00 L225.00,200.00"]
     19    RenderSVGText {text} at (79,236) size 292x18 contains 1 chunk(s)
     20      RenderSVGInlineText {#text} at (0,0) size 292x18
     21        chunk 1 (middle anchor) text run 1 at (79.00,250.00) startOffset 0 endOffset 48 width 292.00: "Both sides of the red line should look identical"
     22    RenderSVGContainer {g} at (249,0) size 202x201 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,0.00)}]
     23      RenderPath {rect} at (249,0) size 102x101 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=RADIAL-GRADIENT] [id="gradient0"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
     24      RenderPath {rect} at (349,0) size 102x101 [stroke={[type=SOLID] [color=#008000]}] [data="M100.00,0.00 L200.00,0.00 L200.00,100.00 L100.00,100.00 Z"]
     25      RenderPath {rect} at (249,99) size 102x102 [stroke={[type=SOLID] [color=#008000]}] [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-mask-expected.checksum

    r63300 r64275  
    1 7f078b4f3971b046bbab30231bfb350c
     1a3e27e4285fbd10b7edbf738101b1339
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-mask-expected.txt

    r63421 r64275  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (0,0) size 150x250
     4  RenderSVGRoot {svg} at (0,0) size 350x204
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    66      RenderSVGResourceMasker {mask} [id="mask1"] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
     
    1414        RenderPath {rect} at (0,0) size 0x0 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M100.00,100.00 L150.00,100.00 L150.00,150.00 L100.00,150.00 Z"]
    1515          [masker="mask2"] RenderSVGResourceMasker {mask} at (0,0) size 0x0
    16       RenderPath {rect} at (0,200) size 50x50 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M0.00,200.00 L50.00,200.00 L50.00,250.00 L0.00,250.00 Z"]
    17         [masker="mask4"] RenderSVGResourceMasker {mask} at (0,200) size 50x50
     16      RenderPath {rect} at (0,100) size 50x50 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M0.00,100.00 L50.00,100.00 L50.00,150.00 L0.00,150.00 Z"]
     17        [masker="mask4"] RenderSVGResourceMasker {mask} at (0,100) size 50x50
    1818      RenderSVGResourceMasker {mask} [id="mask4"] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
    19         RenderSVGContainer {use} at (0,200) size 50x50
    20           RenderSVGContainer {g} at (0,200) size 50x50
    21             RenderPath {rect} at (0,200) size 50x50 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M0.00,200.00 L50.00,200.00 L50.00,250.00 L0.00,250.00 Z"]
    22               [masker="mask4"] RenderSVGResourceMasker {mask} at (0,200) size 50x50
    23     RenderPath {rect} at (0,0) size 50x50 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
     19        RenderSVGContainer {use} at (0,100) size 50x50
     20          RenderSVGContainer {g} at (0,100) size 50x50
     21            RenderPath {rect} at (0,100) size 50x50 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M0.00,100.00 L50.00,100.00 L50.00,150.00 L0.00,150.00 Z"]
     22              [masker="mask4"] RenderSVGResourceMasker {mask} at (0,100) size 50x50
     23    RenderPath {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    2424      [masker="mask1"] RenderSVGResourceMasker {mask} at (0,0) size 50x50
    25     RenderPath {rect} at (100,0) size 50x50 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#0000FF]}] [data="M100.00,0.00 L200.00,0.00 L200.00,100.00 L100.00,100.00 Z"]
     25    RenderPath {rect} at (100,0) size 50x50 [fill={[type=SOLID] [color=#0000FF]}] [data="M100.00,0.00 L200.00,0.00 L200.00,100.00 L100.00,100.00 Z"]
    2626      [masker="mask2"] RenderSVGResourceMasker {mask} at (100,0) size 50x50
    27     RenderPath {rect} at (0,0) size 0x0 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#0000FF]}] [data="M100.00,100.00 L200.00,100.00 L200.00,200.00 L100.00,200.00 Z"]
     27    RenderPath {rect} at (0,0) size 0x0 [fill={[type=SOLID] [color=#0000FF]}] [data="M100.00,100.00 L200.00,100.00 L200.00,200.00 L100.00,200.00 Z"]
    2828      [masker="mask3"] RenderSVGResourceMasker {mask} at (0,0) size 0x0
    29     RenderPath {rect} at (0,200) size 50x50 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,200.00 L100.00,200.00 L100.00,300.00 L0.00,300.00 Z"]
    30       [masker="mask4"] RenderSVGResourceMasker {mask} at (0,200) size 50x50
     29    RenderPath {rect} at (0,100) size 50x50 [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
     30      [masker="mask4"] RenderSVGResourceMasker {mask} at (0,100) size 50x50
     31    RenderPath {line} at (174,0) size 2x150 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#000000]}] [data="M175.00,0.00 L175.00,150.00"]
     32    RenderSVGText {text} at (29,186) size 292x18 contains 1 chunk(s)
     33      RenderSVGInlineText {#text} at (0,0) size 292x18
     34        chunk 1 (middle anchor) text run 1 at (29.00,200.00) startOffset 0 endOffset 48 width 292.00: "Both sides of the red line should look identical"
     35    RenderSVGContainer {g} at (200,0) size 150x150 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,0.00)}]
     36      RenderPath {rect} at (200,0) size 50x50 [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     37      RenderPath {rect} at (300,0) size 50x50 [fill={[type=SOLID] [color=#0000FF]}] [data="M100.00,0.00 L150.00,0.00 L150.00,50.00 L100.00,50.00 Z"]
     38      RenderPath {rect} at (200,100) size 50x50 [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,100.00 L50.00,100.00 L50.00,150.00 L0.00,150.00 Z"]
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-pattern-expected.checksum

    r63421 r64275  
    1 c313c4ce6fc9ac267436fef6a4d7f5d6
     12886112189091c741b0f22d4331cd31c
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-pattern-expected.txt

    r63421 r64275  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (0,0) size 201x401
     4  RenderSVGRoot {svg} at (0,0) size 650x354
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    6       RenderSVGResourcePattern {pattern} [id="pattern1"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    7         RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern1"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    8       RenderSVGResourcePattern {pattern} [id="pattern2"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    9         RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern1"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    10       RenderSVGResourcePattern {pattern} [id="pattern3"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    11       RenderSVGResourcePattern {pattern} [id="pattern4"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    12       RenderSVGResourcePattern {pattern} [id="pattern6"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    13       RenderSVGResourcePattern {pattern} [id="pattern5"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    14         RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern6"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    15       RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern7"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    16       RenderSVGResourcePattern {pattern} [id="pattern7"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    17         RenderSVGContainer {use} at (0,0) size 100x100
    18           RenderSVGContainer {g} at (0,0) size 100x100
    19             RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern7"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    20       RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern8"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    21       RenderSVGContainer {use} at (0,0) size 100x100
    22         RenderSVGContainer {g} at (0,0) size 100x100
    23           RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern8"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    24       RenderSVGResourcePattern {pattern} [id="pattern8"] [patternUnits=objectBoundingBox] [patternContentUnits=userSpaceOnUse]
    25         RenderSVGContainer {use} at (0,0) size 100x100
    26           RenderSVGContainer {g} at (0,0) size 100x100
    27             RenderSVGContainer {g} at (0,0) size 100x100
    28               RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern8"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    29     RenderPath {rect} at (0,0) size 101x101 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern1"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
    30     RenderPath {rect} at (0,99) size 101x102 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern2"]}] [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
    31     RenderPath {rect} at (99,0) size 102x101 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern3"]}] [data="M100.00,0.00 L200.00,0.00 L200.00,100.00 L100.00,100.00 Z"]
    32     RenderPath {rect} at (99,99) size 102x102 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern4"]}] [data="M100.00,100.00 L200.00,100.00 L200.00,200.00 L100.00,200.00 Z"]
    33     RenderPath {rect} at (0,199) size 101x102 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern5"]}] [data="M0.00,200.00 L100.00,200.00 L100.00,300.00 L0.00,300.00 Z"]
    34     RenderPath {rect} at (99,199) size 102x102 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern6"]}] [data="M100.00,200.00 L200.00,200.00 L200.00,300.00 L100.00,300.00 Z"]
    35     RenderPath {rect} at (0,299) size 101x102 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern7"]}] [data="M0.00,300.00 L100.00,300.00 L100.00,400.00 L0.00,400.00 Z"]
    36     RenderPath {rect} at (99,299) size 102x102 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=PATTERN] [id="pattern8"]}] [data="M100.00,300.00 L200.00,300.00 L200.00,400.00 L100.00,400.00 Z"]
     6      RenderSVGResourcePattern {pattern} [id="pattern0"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     7        RenderPath {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     8        RenderPath {rect} at (50,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,50.00 L150.00,50.00 L150.00,150.00 L50.00,150.00 Z"]
     9      RenderSVGResourcePattern {pattern} [id="pattern1"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     10        RenderPath {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     11        RenderPath {rect} at (50,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,50.00 L150.00,50.00 L150.00,150.00 L50.00,150.00 Z"]
     12      RenderSVGResourcePattern {pattern} [id="pattern2"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     13        RenderPath {rect} at (50,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,50.00 L150.00,50.00 L150.00,150.00 L50.00,150.00 Z"]
     14        RenderPath {rect} at (0,0) size 50x50 [fill={[type=PATTERN] [id="pattern1"]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     15      RenderSVGResourcePattern {pattern} [id="pattern3"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     16      RenderSVGResourcePattern {pattern} [id="pattern4"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     17      RenderSVGResourcePattern {pattern} [id="pattern6"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     18      RenderSVGResourcePattern {pattern} [id="pattern5"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     19        RenderPath {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     20        RenderPath {rect} at (50,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,50.00 L150.00,50.00 L150.00,150.00 L50.00,150.00 Z"]
     21      RenderPath {rect} at (0,0) size 50x50 [fill={[type=PATTERN] [id="pattern7"]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     22      RenderSVGResourcePattern {pattern} [id="pattern7"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     23        RenderSVGContainer {use} at (0,0) size 50x50
     24          RenderSVGContainer {g} at (0,0) size 50x50
     25            RenderPath {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     26        RenderPath {rect} at (50,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,50.00 L150.00,50.00 L150.00,150.00 L50.00,150.00 Z"]
     27      RenderPath {rect} at (0,0) size 50x50 [fill={[type=PATTERN] [id="pattern8"]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     28      RenderSVGContainer {use} at (0,0) size 50x50
     29        RenderSVGContainer {g} at (0,0) size 50x50
     30          RenderPath {rect} at (0,0) size 50x50 [fill={[type=PATTERN] [id="pattern8"]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     31      RenderSVGResourcePattern {pattern} [id="pattern8"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     32        RenderSVGContainer {g} at (0,0) size 150x150
     33          RenderSVGContainer {use} at (50,50) size 100x100
     34            RenderSVGContainer {g} at (50,50) size 100x100
     35              RenderPath {rect} at (50,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,50.00 L150.00,50.00 L150.00,150.00 L50.00,150.00 Z"]
     36          RenderSVGContainer {use} at (0,0) size 50x50
     37            RenderSVGContainer {g} at (0,0) size 50x50
     38              RenderSVGContainer {g} at (0,0) size 50x50
     39                RenderPath {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     40      RenderSVGResourcePattern {pattern} [id="pattern9"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
     41        RenderSVGContainer {use} at (0,0) size 150x150
     42          RenderSVGContainer {g} at (0,0) size 150x150
     43            RenderSVGContainer {g} at (0,0) size 150x150
     44              RenderSVGContainer {g} at (50,50) size 100x100
     45                RenderPath {rect} at (50,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M50.00,50.00 L150.00,50.00 L150.00,150.00 L50.00,150.00 Z"]
     46              RenderSVGContainer {g} at (0,0) size 50x50
     47                RenderSVGContainer {g} at (0,0) size 50x50
     48                  RenderPath {rect} at (0,0) size 50x50 [fill={[type=PATTERN] [id="pattern8"]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
     49    RenderPath {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern1"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
     50    RenderPath {rect} at (100,0) size 100x100 [fill={[type=PATTERN] [id="pattern2"]}] [data="M100.00,0.00 L200.00,0.00 L200.00,100.00 L100.00,100.00 Z"]
     51    RenderPath {rect} at (200,0) size 100x100 [fill={[type=PATTERN] [id="pattern3"]}] [data="M200.00,0.00 L300.00,0.00 L300.00,100.00 L200.00,100.00 Z"]
     52    RenderPath {rect} at (0,100) size 100x100 [fill={[type=PATTERN] [id="pattern4"]}] [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
     53    RenderPath {rect} at (100,100) size 100x100 [fill={[type=PATTERN] [id="pattern5"]}] [data="M100.00,100.00 L200.00,100.00 L200.00,200.00 L100.00,200.00 Z"]
     54    RenderPath {rect} at (200,100) size 100x100 [fill={[type=PATTERN] [id="pattern6"]}] [data="M200.00,100.00 L300.00,100.00 L300.00,200.00 L200.00,200.00 Z"]
     55    RenderPath {rect} at (0,200) size 100x100 [fill={[type=PATTERN] [id="pattern7"]}] [data="M0.00,200.00 L100.00,200.00 L100.00,300.00 L0.00,300.00 Z"]
     56    RenderPath {rect} at (100,200) size 100x100 [fill={[type=PATTERN] [id="pattern8"]}] [data="M100.00,200.00 L200.00,200.00 L200.00,300.00 L100.00,300.00 Z"]
     57    RenderPath {rect} at (200,200) size 100x100 [fill={[type=PATTERN] [id="pattern9"]}] [data="M200.00,200.00 L300.00,200.00 L300.00,300.00 L200.00,300.00 Z"]
     58    RenderPath {line} at (324,0) size 2x300 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#000000]}] [data="M325.00,0.00 L325.00,300.00"]
     59    RenderSVGText {text} at (179,336) size 292x18 contains 1 chunk(s)
     60      RenderSVGInlineText {#text} at (0,0) size 292x18
     61        chunk 1 (middle anchor) text run 1 at (179.00,350.00) startOffset 0 endOffset 48 width 292.00: "Both sides of the red line should look identical"
     62    RenderSVGContainer {g} at (350,0) size 300x300 [transform={m=((1.00,0.00)(0.00,1.00)) t=(350.00,0.00)}]
     63      RenderPath {rect} at (350,0) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"]
     64      RenderPath {rect} at (450,0) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M100.00,0.00 L200.00,0.00 L200.00,100.00 L100.00,100.00 Z"]
     65      RenderPath {rect} at (550,0) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M200.00,0.00 L300.00,0.00 L300.00,100.00 L200.00,100.00 Z"]
     66      RenderPath {rect} at (350,100) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M0.00,100.00 L100.00,100.00 L100.00,200.00 L0.00,200.00 Z"]
     67      RenderPath {rect} at (450,100) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M100.00,100.00 L200.00,100.00 L200.00,200.00 L100.00,200.00 Z"]
     68      RenderPath {rect} at (550,100) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M200.00,100.00 L300.00,100.00 L300.00,200.00 L200.00,200.00 Z"]
     69      RenderPath {rect} at (350,200) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M0.00,200.00 L100.00,200.00 L100.00,300.00 L0.00,300.00 Z"]
     70      RenderPath {rect} at (450,200) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M100.00,200.00 L200.00,200.00 L200.00,300.00 L100.00,300.00 Z"]
     71      RenderPath {rect} at (550,200) size 100x100 [fill={[type=PATTERN] [id="pattern0"]}] [data="M200.00,200.00 L300.00,200.00 L300.00,300.00 L200.00,300.00 Z"]
  • trunk/LayoutTests/platform/mac/svg/custom/use-events-crash-expected.txt

    r62922 r64275  
    2020          RenderSVGContainer {g} at (350,25) size 40x40
    2121            RenderPath {rect} at (350,25) size 40x40 [fill={[type=SOLID] [color=#00FF00]}] [data="M0.00,0.00 L40.00,0.00 L40.00,40.00 L0.00,40.00 Z"]
    22 caret: position 0 of child 0 {#text} of child 1 {text} of child 1 {g} of child 3 {g} of child 3 {g} of child 1 {svg} of document
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerHeight-attr-expected.checksum

    r63730 r64275  
    1 224fae800d3d427aba91701730990d02
     17d9ed1ba3cca05516d0a91561ed24feb
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMarkerElement-dom-markerWidth-attr-expected.checksum

    r63730 r64275  
    1 11c3c4e16ba9180cdaeb785027d292e2
     15bf96e5173d6653c73e6163b7e203c72
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerHeight-prop-expected.checksum

    r63730 r64275  
    1 c2ba9334d9a0f68b163099615799ac39
     131c467d114864ed4ea30162d45c6c289
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMarkerElement-svgdom-markerWidth-prop-expected.checksum

    r63730 r64275  
    1 7ef89ade3d06a052d987f755b9dfcaf2
     14080ad4d8c7c50db21c1b2a2b98e0562
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.checksum

    r63730 r64275  
    1 d11382e9cbf749aadd4a0953a865956e
     16669ab446ddc0ff912c784ee18705928
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.checksum

    r63730 r64275  
    1 173b41ad238e25454717720add78ea84
     1cca7e1243ffc4052ae39c1729fe5676a
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskUnits-attr-expected.checksum

    r63730 r64275  
    1 382386d8794e17490484c55f5b025481
     14d9ca776de74d7e38d9e758a89b93d27
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.checksum

    r63730 r64275  
    1 c17365eee489e97e9b1bb7f649414ee1
     1ca73b7faa6d86098712f37b66bbc1c82
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.checksum

    r63730 r64275  
    1 716714632a1b9c8b0c947a52a354e676
     13019c8444d91d7c726cd6a6d2540fb1e
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.checksum

    r63730 r64275  
    1 0c5df953535e3db2abb9d999b01032b7
     170ef44d927c6ad84a702c9771c169905
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.checksum

    r63730 r64275  
    1 d6ce0b1dc577c6fbff58f0f3f4f56d32
     1414528c414a3ad821d167564502995bb
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.checksum

    r63730 r64275  
    1 0e2770c1b7a4543ad89484ef9fa5a0b6
     151768de61cfef35e4c8f5d45029ffa8c
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskUnits-prop-expected.checksum

    r63730 r64275  
    1 4dcda8de30ac50477518851d437d282d
     121e1b5d7baf0d61fe046185ce31c8263
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.checksum

    r63730 r64275  
    1 5d0b62709f3a4d7733ab98e58ccc7b1f
     1d79313dfe1948cb30b740f17f7861030
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.checksum

    r63730 r64275  
    1 b0d903966f3ebfa1be3346b5bd0a8521
     1bb05754e3fbf1cd483529bc6024a8e0e
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.checksum

    r63730 r64275  
    1 0ec6e3c4aef5a60c2b8f0efcc05b26cb
     1a3b34c5887a55c800641ee576b137d06
  • trunk/LayoutTests/platform/mac/svg/hixie/error/017-expected.txt

    r62922 r64275  
    77        RenderSVGContainer {use} at (0,0) size 0x0
    88          RenderSVGContainer {g} at (0,0) size 0x0
    9             RenderSVGContainer {g} at (0,0) size 0x0
    10               RenderSVGContainer {g} at (0,0) size 0x0
    119      RenderSVGContainer {g} at (0,0) size 0x0
    1210        RenderSVGContainer {use} at (0,0) size 0x0
  • trunk/LayoutTests/svg/clip-path/clip-path-recursive-call-by-child.svg

    r63420 r64275  
    22<defs>
    33    <clipPath id="clip">
    4         <rect x="0" y="0" width="100" height="50" clip-path="url(#clip)"/>
     4        <rect x="0" y="0" width="100" height="100" clip-path="url(#clip)"/>
    55    </clipPath>
    66</defs>
  • trunk/LayoutTests/svg/custom/js-late-clipPath-and-object-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createClipPath()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<g id="content" transform="scale(1, 1.5)"/>
    55<script>
    66    var content = document.getElementById("content");
    7  
     7
     8    if (window.layoutTestController)
     9        layoutTestController.waitUntilDone();
     10
     11    setTimeout(createObject, 0);
     12
    813    function createObject()
    914    {
     
    1722        text.appendChild(document.createTextNode("Clipped. INVISIBLE."));       
    1823        content.appendChild(text);
     24
     25        setTimeout(createClipPath, 0);
    1926    }
    2027
    2128    function createClipPath()
    2229    {
    23         createObject();
    24 
    2530        var clipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath");
    2631        clipPath.setAttribute("id", "dynClip");
     
    3237        clipPath.appendChild(path);
    3338        content.appendChild(clipPath);
     39
     40        if (window.layoutTestController)
     41            layoutTestController.notifyDone();
    3442    }
    3543</script>
  • trunk/LayoutTests/svg/custom/js-late-clipPath-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createClipPath()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<g id="content" transform="scale(1, 1.5)">
    55     <text font-size="60" fill="navy" clip-path="url(#dynClip)" x="10" y="70">Clipped. INVISIBLE.</text>
     
    77<script>
    88    var content = document.getElementById("content");
     9
     10    if (window.layoutTestController)
     11        layoutTestController.waitUntilDone();
     12
     13    setTimeout(createClipPath, 0);
    914
    1015    function createClipPath()
     
    1924        clipPath.appendChild(path);
    2025        content.appendChild(clipPath);
     26
     27        if (window.layoutTestController)
     28            layoutTestController.notifyDone();
    2129    }
    2230</script>
  • trunk/LayoutTests/svg/custom/js-late-gradient-and-object-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createGradients()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<g id="content"/>
    55
    66<script>
    7         var content = document.getElementById("content");
     7    var content = document.getElementById("content");
    88
    9         function createGradients()
    10         {
    11                 // Setup "fillLinearGradient"
    12                 var gradient1 = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient");
    13                 gradient1.setAttribute("id", "fillLinearGradient");
    14                 gradient1.setAttribute("x1", "0");
    15                 gradient1.setAttribute("x2", "1");
     9    if (window.layoutTestController)
     10        layoutTestController.waitUntilDone();
    1611
    17                 var stop11 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
    18                 stop11.setAttribute("stop-color", "blue");
    19                 stop11.setAttribute("offset", "0");
     12    setTimeout(createGradients, 0);
    2013
    21                 var stop21 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
    22                 stop21.setAttribute("stop-color", "red");
    23                 stop21.setAttribute("offset", "1");
     14    function createGradients()
     15    {
     16        // Setup "fillLinearGradient"
     17        var gradient1 = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient");
     18        gradient1.setAttribute("id", "fillLinearGradient");
     19        gradient1.setAttribute("x1", "0");
     20        gradient1.setAttribute("x2", "1");
    2421
    25                 gradient1.appendChild(stop11);
    26                 gradient1.appendChild(stop21);
     22        var stop11 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
     23        stop11.setAttribute("stop-color", "blue");
     24        stop11.setAttribute("offset", "0");
    2725
    28                 content.appendChild(gradient1);
     26        var stop21 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
     27        stop21.setAttribute("stop-color", "red");
     28        stop21.setAttribute("offset", "1");
    2929
    30                 // Setup "strokeLinearGradient"
    31                 var gradient2 = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient");
    32                 gradient2.setAttribute("id", "strokeLinearGradient");
    33                 gradient2.setAttribute("x1", "0");
    34                 gradient2.setAttribute("x2", "1");
     30        gradient1.appendChild(stop11);
     31        gradient1.appendChild(stop21);
    3532
    36                 var stop22 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
    37                 stop22.setAttribute("stop-color", "yellow");
    38                 stop22.setAttribute("offset", "0");
     33        content.appendChild(gradient1);
    3934
    40                 var stop22 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
    41                 stop22.setAttribute("stop-color", "green");
    42                 stop22.setAttribute("offset", "1");
     35        // Setup "strokeLinearGradient"
     36        var gradient2 = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient");
     37        gradient2.setAttribute("id", "strokeLinearGradient");
     38        gradient2.setAttribute("x1", "0");
     39        gradient2.setAttribute("x2", "1");
    4340
    44                 gradient2.appendChild(stop22);
    45                 gradient2.appendChild(stop22);
     41        var stop22 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
     42        stop22.setAttribute("stop-color", "yellow");
     43        stop22.setAttribute("offset", "0");
    4644
    47                 content.appendChild(gradient2);
     45        var stop22 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
     46        stop22.setAttribute("stop-color", "green");
     47        stop22.setAttribute("offset", "1");
    4848
    49                 setupGradientUsers();
    50         }
     49        gradient2.appendChild(stop22);
     50        gradient2.appendChild(stop22);
    5151
    52         function setupGradientUsers()
    53         {
    54                 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text");
    55                 text1.setAttribute("font-size", "68");
    56                 text1.setAttribute("x", "-150");
    57                 text1.setAttribute("y", "70")
    58                 text1.setAttribute("fill", "url(#fillLinearGradient)");
    59                 text1.setAttribute("stroke", "none");
    60                 text1.appendChild(document.createTextNode("Gradient on fill"));
     52        content.appendChild(gradient2);
     53        setTimeout(setupGradientUsers, 0);
     54    }
    6155
    62                 content.appendChild(text1);
     56    function setupGradientUsers()
     57    {
     58        var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text");
     59        text1.setAttribute("font-size", "68");
     60        text1.setAttribute("x", "-150");
     61        text1.setAttribute("y", "70")
     62        text1.setAttribute("fill", "url(#fillLinearGradient)");
     63        text1.setAttribute("stroke", "none");
     64        text1.appendChild(document.createTextNode("Gradient on fill"));
    6365
    64                 var text2 = document.createElementNS("http://www.w3.org/2000/svg", "text");
    65                 text2.setAttribute("font-size", "68");
    66                 text2.setAttribute("x", "-150");
    67                 text2.setAttribute("y", "140")
    68                 text2.setAttribute("fill", "none");     
    69                 text2.setAttribute("stroke", "url(#strokeLinearGradient)");
    70                 text2.appendChild(document.createTextNode("Gradient on stroke"));
     66        content.appendChild(text1);
    7167
    72                 content.appendChild(text2);
     68        var text2 = document.createElementNS("http://www.w3.org/2000/svg", "text");
     69        text2.setAttribute("font-size", "68");
     70        text2.setAttribute("x", "-150");
     71        text2.setAttribute("y", "140")
     72        text2.setAttribute("fill", "none");   
     73        text2.setAttribute("stroke", "url(#strokeLinearGradient)");
     74        text2.appendChild(document.createTextNode("Gradient on stroke"));
    7375
    74                 var text3 = document.createElementNS("http://www.w3.org/2000/svg", "text");
    75                 text3.setAttribute("font-size", "68");
    76                 text3.setAttribute("x", "-150");
    77                 text3.setAttribute("y", "210")
    78                 text3.setAttribute("fill", "url(#fillLinearGradient)");
    79                 text3.setAttribute("stroke", "url(#strokeLinearGradient)");
    80                 text3.appendChild(document.createTextNode("Gradient on fill/stroke"));
     76        content.appendChild(text2);
    8177
    82                 content.appendChild(text3);
    83         }
     78        var text3 = document.createElementNS("http://www.w3.org/2000/svg", "text");
     79        text3.setAttribute("font-size", "68");
     80        text3.setAttribute("x", "-150");
     81        text3.setAttribute("y", "210")
     82        text3.setAttribute("fill", "url(#fillLinearGradient)");   
     83        text3.setAttribute("stroke", "url(#strokeLinearGradient)");
     84        text3.appendChild(document.createTextNode("Gradient on fill/stroke"));
     85
     86        content.appendChild(text3);
     87
     88        if (window.layoutTestController)
     89            layoutTestController.notifyDone();
     90    }
    8491</script>
    8592
  • trunk/LayoutTests/svg/custom/js-late-gradient-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createGradient()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<g id="content" transform="scale(1, 1.5)">
    55     <text font-size="68" fill="url(#dynGrad)"  x="20" y="70">Gradient on fill</text>
    66</g>
    77<script>
    8         var content = document.getElementById("content");
     8    var content = document.getElementById("content");
    99
    10         function createGradient()
    11         {
    12                 var gradient = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient");
    13                 gradient.setAttribute("id", "dynGrad");
    14                 gradient.setAttribute("x1", "0");
    15                 gradient.setAttribute("x2", "1");
     10    if (window.layoutTestController)
     11        layoutTestController.waitUntilDone();
    1612
    17                 var stop1 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
    18                 stop1.setAttribute("stop-color", "blue");
    19                 stop1.setAttribute("offset", "0");
     13    setTimeout(createGradient, 0);
    2014
    21                 var stop2 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
    22                 stop2.setAttribute("stop-color", "red");
    23                 stop2.setAttribute("offset", "1");
     15    function createGradient()
     16    {
     17        var gradient = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient");
     18        gradient.setAttribute("id", "dynGrad");
     19        gradient.setAttribute("x1", "0");
     20        gradient.setAttribute("x2", "1");
    2421
    25                 gradient.appendChild(stop1);
    26                 gradient.appendChild(stop2);
     22        var stop1 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
     23        stop1.setAttribute("stop-color", "blue");
     24        stop1.setAttribute("offset", "0");
    2725
    28                 content.appendChild(gradient);
    29         }
     26        var stop2 = document.createElementNS("http://www.w3.org/2000/svg", "stop");
     27        stop2.setAttribute("stop-color", "red");
     28        stop2.setAttribute("offset", "1");
     29
     30        gradient.appendChild(stop1);
     31        gradient.appendChild(stop2);
     32
     33        content.appendChild(gradient);
     34
     35        if (window.layoutTestController)
     36            layoutTestController.notifyDone();
     37    }
    3038</script>
    3139
  • trunk/LayoutTests/svg/custom/js-late-marker-and-object-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createMarker()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<defs id="defs">
    55    <marker id="markerStart" viewBox="0 0 10 10" markerWidth="2" markerHeight="2" refX="5" refY="5" markerUnits="strokeWidth">
     
    1717    var content = document.getElementById("content");
    1818
     19    if (window.layoutTestController)
     20        layoutTestController.waitUntilDone();
     21
     22    setTimeout(createObject, 0);
     23
    1924    function createObject()
    2025    {
     
    2934
    3035        content.appendChild(path);
     36        setTimeout(createMarker, 0);
    3137    }
    3238
    3339    function createMarker()
    3440    {
    35         createObject();
    36 
    3741        var marker = document.createElementNS("http://www.w3.org/2000/svg", "marker");
    3842        marker.setAttribute("id", "markerMiddle");
     
    5357        marker.appendChild(circle);
    5458        defs.appendChild(marker);
     59
     60        if (window.layoutTestController)
     61            layoutTestController.notifyDone();
    5562    }
    5663</script>
  • trunk/LayoutTests/svg/custom/js-late-marker-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createMarker()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<defs id="defs">
    55    <marker id="markerStart" viewBox="0 0 10 10" markerWidth="2" markerHeight="2" refX="5" refY="5" markerUnits="strokeWidth">
     
    1616<script>
    1717    var defs = document.getElementById("defs");
     18
     19    if (window.layoutTestController)
     20        layoutTestController.waitUntilDone();
     21
     22    setTimeout(createMarker, 0);
    1823
    1924    function createMarker()
     
    3742        marker.appendChild(circle);
    3843        defs.appendChild(marker);
     44
     45        if (window.layoutTestController)
     46            layoutTestController.notifyDone();
    3947    }
    4048</script>
  • trunk/LayoutTests/svg/custom/js-late-mask-and-object-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 800 600" onload="createMask()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 800 600">
    44
    55<g id="content"/>
     
    77<script>
    88    var content = document.getElementById("content");
     9
     10    if (window.layoutTestController)
     11        layoutTestController.waitUntilDone();
     12
     13    setTimeout(createObject, 0);
    914
    1015    function createObject()
     
    1823
    1924        content.appendChild(rect);
     25        setTimeout(createMask, 0);
    2026    }
    2127
    2228    function createMask()
    2329    {
    24         createObject();
    25 
    2630        var mask = document.createElementNS("http://www.w3.org/2000/svg", "mask");
    2731        mask.setAttribute("id", "dynMask");
     
    3943        mask.appendChild(rect);
    4044        content.appendChild(mask);
     45
     46        if (window.layoutTestController)
     47            layoutTestController.notifyDone();
    4148    }
    4249</script>
  • trunk/LayoutTests/svg/custom/js-late-mask-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 800 600" onload="createMask()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 800 600">
    44
    55<rect x="0" y="100" width="800" height="100" fill="blue" mask="url(#dynMask)"/>
     
    88<script>
    99    var content = document.getElementById("content");
     10
     11    if (window.layoutTestController)
     12        layoutTestController.waitUntilDone();
     13
     14    setTimeout(createMask, 0);
    1015
    1116    function createMask()
     
    2631        mask.appendChild(rect);
    2732        content.appendChild(mask);
     33
     34        if (window.layoutTestController)
     35            layoutTestController.notifyDone();
    2836    }
    2937</script>
  • trunk/LayoutTests/svg/custom/js-late-pattern-and-object-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createPatterns()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<g id="content"/>
    55
    66<script>
    7         var content = document.getElementById("content");
     7    var content = document.getElementById("content");
    88
    9         function createPatterns()
    10         {
    11                 // Setup "fillPattern" 
    12                 var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
    13                 pattern1.setAttribute("id", "fillPattern");
    14                 pattern1.setAttribute("patternUnits", "userSpaceOnUse");
    15                 pattern1.setAttribute("x", "0");
    16                 pattern1.setAttribute("y", "0");
    17                 pattern1.setAttribute("width", "20");
    18                 pattern1.setAttribute("height", "20");
     9    if (window.layoutTestController)
     10        layoutTestController.waitUntilDone();
    1911
    20                 var rect11 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
    21                 rect11.setAttribute("x", "5");
    22                 rect11.setAttribute("y", "5");
    23                 rect11.setAttribute("width", "10");
    24                 rect11.setAttribute("height", "10");
    25                 rect11.setAttribute("fill", "red");
     12    setTimeout(createPatterns, 0);
    2613
    27                 var rect21 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
    28                 rect21.setAttribute("x", "10");
    29                 rect21.setAttribute("y", "10");
    30                 rect21.setAttribute("width", "10");
    31                 rect21.setAttribute("height", "10");
    32                 rect21.setAttribute("fill", "green");
     14    function createPatterns()
     15    {
     16        // Setup "fillPattern"   
     17        var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
     18        pattern1.setAttribute("id", "fillPattern");
     19        pattern1.setAttribute("patternUnits", "userSpaceOnUse");
     20        pattern1.setAttribute("x", "0");
     21        pattern1.setAttribute("y", "0");
     22        pattern1.setAttribute("width", "20");
     23        pattern1.setAttribute("height", "20");
    3324
    34                 pattern1.appendChild(rect11);
    35                 pattern1.appendChild(rect21);
     25        var rect11 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
     26        rect11.setAttribute("x", "5");
     27        rect11.setAttribute("y", "5");
     28        rect11.setAttribute("width", "10");
     29        rect11.setAttribute("height", "10");
     30        rect11.setAttribute("fill", "red");
    3631
    37                 content.appendChild(pattern1);
     32        var rect21 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
     33        rect21.setAttribute("x", "10");
     34        rect21.setAttribute("y", "10");
     35        rect21.setAttribute("width", "10");
     36        rect21.setAttribute("height", "10");
     37        rect21.setAttribute("fill", "green");
    3838
    39                 // Setup "strokePattern"       
    40                 var pattern2 = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
    41                 pattern2.setAttribute("id", "strokePattern");
    42                 pattern2.setAttribute("patternUnits", "userSpaceOnUse");
    43                 pattern2.setAttribute("x", "0");
    44                 pattern2.setAttribute("y", "0");
    45                 pattern2.setAttribute("width", "20");
    46                 pattern2.setAttribute("height", "20");
     39        pattern1.appendChild(rect11);
     40        pattern1.appendChild(rect21);
    4741
    48                 var rect12 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
    49                 rect12.setAttribute("x", "5");
    50                 rect12.setAttribute("y", "5");
    51                 rect12.setAttribute("width", "10");
    52                 rect12.setAttribute("height", "10");
    53                 rect12.setAttribute("fill", "yellow");
     42        content.appendChild(pattern1);
    5443
    55                 var rect22 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
    56                 rect22.setAttribute("x", "10");
    57                 rect22.setAttribute("y", "10");
    58                 rect22.setAttribute("width", "10");
    59                 rect22.setAttribute("height", "10");
    60                 rect22.setAttribute("fill", "blue");
     44        // Setup "strokePattern"   
     45        var pattern2 = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
     46        pattern2.setAttribute("id", "strokePattern");
     47        pattern2.setAttribute("patternUnits", "userSpaceOnUse");
     48        pattern2.setAttribute("x", "0");
     49        pattern2.setAttribute("y", "0");
     50        pattern2.setAttribute("width", "20");
     51        pattern2.setAttribute("height", "20");
    6152
    62                 pattern2.appendChild(rect12);
    63                 pattern2.appendChild(rect22);
     53        var rect12 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
     54        rect12.setAttribute("x", "5");
     55        rect12.setAttribute("y", "5");
     56        rect12.setAttribute("width", "10");
     57        rect12.setAttribute("height", "10");
     58        rect12.setAttribute("fill", "yellow");
    6459
    65                 content.appendChild(pattern2);
     60        var rect22 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
     61        rect22.setAttribute("x", "10");
     62        rect22.setAttribute("y", "10");
     63        rect22.setAttribute("width", "10");
     64        rect22.setAttribute("height", "10");
     65        rect22.setAttribute("fill", "blue");
    6666
    67                 setupPatternUsers();
    68         }
     67        pattern2.appendChild(rect12);
     68        pattern2.appendChild(rect22);
    6969
    70         function setupPatternUsers()
    71         {
    72                 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text");
    73                 text1.setAttribute("font-size", "68");
    74                 text1.setAttribute("x", "-150");
    75                 text1.setAttribute("y", "70")
    76                 text1.setAttribute("fill", "url(#fillPattern)");
    77                 text1.setAttribute("stroke", "none");
    78                 text1.appendChild(document.createTextNode("Pattern on fill"));
     70        content.appendChild(pattern2);
    7971
    80                 content.appendChild(text1);
     72        setTimeout(setupPatternUsers, 0);
     73    }
    8174
    82                 var text2 = document.createElementNS("http://www.w3.org/2000/svg", "text");
    83                 text2.setAttribute("font-size", "68");
    84                 text2.setAttribute("x", "-150");
    85                 text2.setAttribute("y", "140")
    86                 text2.setAttribute("fill", "none");     
    87                 text2.setAttribute("stroke", "url(#strokePattern)");
    88                 text2.appendChild(document.createTextNode("Pattern on stroke"));
     75    function setupPatternUsers()
     76    {
     77        var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text");
     78        text1.setAttribute("font-size", "68");
     79        text1.setAttribute("x", "-150");
     80        text1.setAttribute("y", "70")
     81        text1.setAttribute("fill", "url(#fillPattern)");
     82        text1.setAttribute("stroke", "none");
     83        text1.appendChild(document.createTextNode("Pattern on fill"));
    8984
    90                 content.appendChild(text2);
     85        content.appendChild(text1);
    9186
    92                 var text3 = document.createElementNS("http://www.w3.org/2000/svg", "text");
    93                 text3.setAttribute("font-size", "68");
    94                 text3.setAttribute("x", "-150");
    95                 text3.setAttribute("y", "210")
    96                 text3.setAttribute("fill", "url(#fillPattern)");       
    97                 text3.setAttribute("stroke", "url(#strokePattern)");
    98                 text3.appendChild(document.createTextNode("Pattern on fill/stroke"));
     87        var text2 = document.createElementNS("http://www.w3.org/2000/svg", "text");
     88        text2.setAttribute("font-size", "68");
     89        text2.setAttribute("x", "-150");
     90        text2.setAttribute("y", "140")
     91        text2.setAttribute("fill", "none");   
     92        text2.setAttribute("stroke", "url(#strokePattern)");
     93        text2.appendChild(document.createTextNode("Pattern on stroke"));
    9994
    100                 content.appendChild(text3);
    101         }
     95        content.appendChild(text2);
     96
     97        var text3 = document.createElementNS("http://www.w3.org/2000/svg", "text");
     98        text3.setAttribute("font-size", "68");
     99        text3.setAttribute("x", "-150");
     100        text3.setAttribute("y", "210")
     101        text3.setAttribute("fill", "url(#fillPattern)");   
     102        text3.setAttribute("stroke", "url(#strokePattern)");
     103        text3.appendChild(document.createTextNode("Pattern on fill/stroke"));
     104
     105        content.appendChild(text3);
     106
     107        if (window.layoutTestController)
     108            layoutTestController.notifyDone();
     109    }
    102110</script>
    103111
  • trunk/LayoutTests/svg/custom/js-late-pattern-creation.svg

    r24146 r64275  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> 
    3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="createPattern()">
     3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
    44<g id="content" transform="scale(1, 1.5)">
    55     <text font-size="68" fill="url(#dynPattern)"  x="20" y="70">Pattern on fill</text>
    66</g>
    77<script>
    8         var content = document.getElementById("content");
     8    var content = document.getElementById("content");
    99
    10         function createPattern()
    11         {
    12                 var pattern = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
    13                 pattern.setAttribute("id", "dynPattern");
    14                 pattern.setAttribute("patternUnits", "userSpaceOnUse");
    15                 pattern.setAttribute("x", "0");
    16                 pattern.setAttribute("y", "0");
    17                 pattern.setAttribute("width", "20");
    18                 pattern.setAttribute("height", "20");
     10    if (window.layoutTestController)
     11        layoutTestController.waitUntilDone();
    1912
    20                 var rect1 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
    21                 rect1.setAttribute("x", "5");
    22                 rect1.setAttribute("y", "5");
    23                 rect1.setAttribute("width", "10");
    24                 rect1.setAttribute("height", "10");
    25                 rect1.setAttribute("fill", "red");
     13    setTimeout(createPattern, 0);
    2614
    27                 var rect2 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
    28                 rect2.setAttribute("x", "10");
    29                 rect2.setAttribute("y", "10");
    30                 rect2.setAttribute("width", "10");
    31                 rect2.setAttribute("height", "10");
    32                 rect2.setAttribute("fill", "green");
     15    function createPattern()
     16    {
     17        var pattern = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
     18        pattern.setAttribute("id", "dynPattern");
     19        pattern.setAttribute("patternUnits", "userSpaceOnUse");
     20        pattern.setAttribute("x", "0");
     21        pattern.setAttribute("y", "0");
     22        pattern.setAttribute("width", "20");
     23        pattern.setAttribute("height", "20");
    3324
    34                 pattern.appendChild(rect1);
    35                 pattern.appendChild(rect2);
     25        var rect1 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
     26        rect1.setAttribute("x", "5");
     27        rect1.setAttribute("y", "5");
     28        rect1.setAttribute("width", "10");
     29        rect1.setAttribute("height", "10");
     30        rect1.setAttribute("fill", "red");
    3631
    37                 content.appendChild(pattern);
    38         }
     32        var rect2 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
     33        rect2.setAttribute("x", "10");
     34        rect2.setAttribute("y", "10");
     35        rect2.setAttribute("width", "10");
     36        rect2.setAttribute("height", "10");
     37        rect2.setAttribute("fill", "green");
     38
     39        pattern.appendChild(rect1);
     40        pattern.appendChild(rect2);
     41
     42        content.appendChild(pattern);
     43
     44        if (window.layoutTestController)
     45            layoutTestController.notifyDone();
     46    }
    3947</script>
    4048
  • trunk/LayoutTests/svg/custom/recursive-clippath.svg

    r63421 r64275  
    22<defs>
    33    <clipPath id='clipPath_0'>
    4         <rect x='0' y='0' width='100' height='100' fill='none' clip-path='url(#clipPath_0)'/>
     4        <rect x='50' y='0' width='50' height='50' fill='none' clip-path='url(#clipPath_0)'/>
    55    </clipPath>
    66
    7     <rect x='0' y='100' width='100' height='100' id="rect" fill='none' clip-path='url(#clipPath_1)'/>
     7    <rect x='50' y='150' width='50' height='50' id="rect" fill='none' clip-path='url(#clipPath_1)'/>
    88    <clipPath id='clipPath_1'>
    99        <use xlink:href="#rect"/>
     
    1414Spec: clip-path: If the IRI reference is not valid (e.g it points to an object that doesn't exist or the object
    1515                 is not a ‘clipPath’ element) the ‘clip-path’ property must be treated as if it hadn't been specified.
    16 
    17       Our view is that an clipPath containing a cycle is not valid, and thus should be ignored.
    18       But the object that references the clipPath should still be drawn.
    1916-->
    2017
    21 <rect x='0' y='0' width='200' height='200' fill='red'/>
    22 <rect x='0' y='0' width='200' height='200' fill='green' clip-path='url(#clipPath_0)'/>
     18<rect x='50' y='0' width='100' height='100' fill='blue'/>
     19<rect x='50' y='0' width='100' height='100' fill='green' clip-path='url(#clipPath_0)'/>
    2320
    24 <rect x='0' y='100' width='200' height='200' fill='red'/>
    25 <rect x='0' y='100' width='200' height='200' fill='green' clip-path='url(#clipPath_1)'/>
     21<rect x='50' y='150' width='100' height='100' fill='blue'/>
     22<rect x='50' y='150' width='100' height='100' fill='green' clip-path='url(#clipPath_1)'/>
     23
     24<line x1="175" x2="175" y1="0" y2="250" stroke="red"/>
     25<text text-anchor="middle" x="175" y="300">Both sides of the red line should look identical</text>
     26
     27<!-- This is the reference rendering -->
     28<g transform="translate(150,0)">
     29    <rect x="50" y="0" width="100" height="100" fill="blue"/>
     30    <rect x="50" y="0" width="50" height="50" fill="green"/>
     31    <rect x="50" y="150" width="100" height="100" fill="blue"/>
     32    <rect x="50" y="150" width="50" height="50" fill="green"/>
     33</g>
    2634</svg>
  • trunk/LayoutTests/svg/custom/recursive-filter.svg

    r63300 r64275  
    11<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    22<defs>
     3    <filter id="filter0">
     4        <feGaussianBlur stdDeviation="4"/>
     5    </filter>
     6
    37    <filter id="filter1" filter="url(#filter1)">
    48        <feGaussianBlur stdDeviation="4"/>
    59    </filter>
    610
     11    <!-- WebKit currently does not implement filter chaining -->
    712    <filter id="filter2" xlink:href="#filter2"/>
    813</defs>
    914
    1015<!-- This should be blurred -->
    11 <rect x="0" y="0" width="100" height="100" filter="url(#filter1)" fill="blue" stroke="green"/>
     16<rect x="50" y="0" width="100" height="100" filter="url(#filter1)" fill="blue"/>
    1217
    13 <!-- This should not crash and not render anything -->
    14 <rect x="0" y="100" width="100" height="100" filter="url(#filter2)" fill="blue" stroke="green"/>
     18<!-- This should not render anything -->
     19<rect x="50" y="150" width="100" height="100" filter="url(#filter2)" fill="blue"/>
     20
     21<line x1="175" x2="175" y1="0" y2="250" stroke="red"/>
     22<text text-anchor="middle" x="175" y="300">Both sides of the red line should look identical</text>
     23
     24<!-- This is the reference rendering -->
     25<g transform="translate(150,0)">
     26    <rect x="50" y="0" width="100" height="100" filter="url(#filter0)" fill="blue"/>
     27</g>
    1528</svg>
  • trunk/LayoutTests/svg/custom/recursive-gradient.svg

    r63416 r64275  
    11<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    22<defs>
     3    <radialGradient id="gradient0" gradientUnits="objectBoundingBox" cx=".5" cy=".5" fx=".5" fy=".5" r=".5">
     4        <stop stop-color="blue" offset="0"/>
     5        <stop stop-color="red" offset="1"/>
     6    </radialGradient>
     7
    38    <radialGradient xlink:href="#gradient1" id="gradient1" gradientUnits="objectBoundingBox" cx=".5" cy=".5" fx=".5" fy=".5" r=".5">
    49        <stop stop-color="blue" offset="0"/>
    510        <stop stop-color="red" offset="1"/>
    611    </radialGradient>
    7     <radialGradient id="gradient2" xlink:href="#gradient3"/>
     12
     13    <radialGradient id="gradient2" xlink:href="#gradient4"/>
     14    <radialGradient id="gradient4" xlink:href="#gradient2"/>
    815    <radialGradient id="gradient3" xlink:href="#gradient2"/>
    916</defs>
    1017
    11 <!-- This should not crash -->
     18<!-- This should render with a gradient -->
    1219<rect x="0" y="0" width="100" height="100" fill="url(#gradient1)" stroke="green"/>
     20
     21<!-- This should not render anything -->
    1322<rect x="100" y="0" width="100" height="100" fill="url(#gradient2)" stroke="green"/>
     23
     24<!-- This should not render anything -->
    1425<rect x="0" y="100" width="100" height="100" fill="url(#gradient3)" stroke="green"/>
     26
     27<line x1="225" x2="225" y1="0" y2="200" stroke="red"/>
     28<text text-anchor="middle" x="225" y="250">Both sides of the red line should look identical</text>
     29
     30<!-- This is the reference rendering -->
     31<g transform="translate(250,0)">
     32    <rect x="0" y="0" width="100" height="100" fill="url(#gradient0)" stroke="green"/>
     33    <rect x="100" y="0" width="100" height="100" fill="none" stroke="green"/>
     34    <rect x="0" y="100" width="100" height="100" fill="none" stroke="green"/>
     35</g>
    1536</svg>
  • trunk/LayoutTests/svg/custom/recursive-mask.svg

    r63421 r64275  
    1414    </mask>
    1515
    16     <rect id="rect" x="0" y="200" width="50" height="50" fill="white" mask="url(#mask4)"/>
     16    <rect id="rect" x="0" y="100" width="50" height="50" fill="white" mask="url(#mask4)"/>
    1717    <mask id="mask4">
    1818        <use xlink:href="#rect"/>
     
    2020</defs>
    2121
    22 <!-- This should be masked, resulting in a 50x50 rect -->
    23 <rect x="0" y="0" width="100" height="100" fill="blue" mask="url(#mask1)" stroke="green"/>
     22<!-- This should result in a 50x50 rect -->
     23<rect x="0" y="0" width="100" height="100" fill="blue" mask="url(#mask1)"/>
    2424
    25 <!-- This should not render anything -->
    26 <rect x="100" y="0" width="100" height="100" fill="blue" mask="url(#mask2)" stroke="green"/>
     25<!-- This should result in a 50x50 rect -->
     26<rect x="100" y="0" width="100" height="100" fill="blue" mask="url(#mask2)"/>
    2727
    28 <!-- This should not render anything -->
    29 <rect x="100" y="100" width="100" height="100" fill="blue" mask="url(#mask3)" stroke="green"/>
     28<!-- This should not render -->
     29<rect x="100" y="100" width="100" height="100" fill="blue" mask="url(#mask3)"/>
    3030
    31 <!-- This should not render anything -->
    32 <rect x="0" y="200" width="100" height="100" fill="blue" mask="url(#mask4)" stroke="green"/>
     31<!-- This should result in a 50x50 rect -->
     32<rect x="0" y="100" width="100" height="100" fill="blue" mask="url(#mask4)"/>
     33
     34<line x1="175" x2="175" y1="0" y2="150" stroke="red"/>
     35<text text-anchor="middle" x="175" y="200">Both sides of the red line should look identical</text>
     36
     37<!-- This is the reference rendering -->
     38<g transform="translate(200,0)">
     39    <rect x="0" y="0" width="50" height="50" fill="blue"/>
     40    <rect x="100" y="0" width="50" height="50" fill="blue"/>
     41    <rect x="0" y="100" width="50" height="50" fill="blue"/>
     42</g>
    3343</svg>
  • trunk/LayoutTests/svg/custom/recursive-pattern.svg

    r63421 r64275  
    11<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    22<defs>
    3     <pattern id="pattern1" x="0" y="0" width="100" height="100">
    4         <rect x="0" y="0" width="100" height="100" fill="url(#pattern1)"/>
     3    <pattern patternUnits="userSpaceOnUse" id="pattern0" x="0" y="0" width="100" height="100">
     4        <rect x="0" y="0" width="50" height="50" fill="black"/>
     5        <rect x="50" y="50" width="100" height="100" fill="green"/>
    56    </pattern>
    67
    7     <pattern id="pattern2" x="0" y="0" width="100" height="100">
    8         <rect x="0" y="0" width="100" height="100" fill="url(#pattern1)"/>
     8    <pattern patternUnits="userSpaceOnUse" id="pattern1" x="0" y="0" width="100" height="100">
     9        <rect x="0" y="0" width="50" height="50" fill="url(#pattern1)"/>
     10        <rect x="50" y="50" width="100" height="100" fill="green"/>
     11    </pattern>
     12
     13    <pattern patternUnits="userSpaceOnUse" id="pattern2" x="0" y="0" width="100" height="100">
     14        <rect x="50" y="50" width="100" height="100" fill="green"/>
     15        <rect x="0" y="0" width="50" height="50" fill="url(#pattern1)"/>
    916    </pattern>
    1017
     
    1320
    1421    <pattern id="pattern6" xlink:href="#pattern5"/>
    15     <pattern id="pattern5" x="0" y="0" width="100" height="100">
    16         <rect x="0" y="0" width="100" height="100" fill="url(#pattern6)"/>
     22    <pattern patternUnits="userSpaceOnUse"  id="pattern5" x="0" y="0" width="100" height="100">
     23        <rect x="0" y="0" width="50" height="50" fill="url(#pattern6)"/>
     24        <rect x="50" y="50" width="100" height="100" fill="green"/>
    1725    </pattern>
    1826
    19     <rect id="rect" x="0" y="0" width="100" height="100" fill="url(#pattern7)"/>
    20     <pattern id="pattern7" x="0" y="0" width="100" height="100">
     27    <rect id="rect" x="0" y="0" width="50" height="50" fill="url(#pattern7)"/>
     28    <pattern patternUnits="userSpaceOnUse" id="pattern7" x="0" y="0" width="100" height="100">
    2129        <use xlink:href="#rect"/>
     30        <rect id="reuse" x="50" y="50" width="100" height="100" fill="green"/>
    2231    </pattern>
    2332   
    24         <rect id="rect2" x="0" y="0" width="100" height="100" fill="url(#pattern8)"/>
    25         <use id="use" xlink:href="#rect2"/>
    26     <pattern id="pattern8" x="0" y="0" width="100" height="100">
    27         <use xlink:href="#use"/>
     33    <rect id="rect2" x="0" y="0" width="50" height="50" fill="url(#pattern8)"/>
     34    <use id="use" xlink:href="#rect2"/>
     35    <pattern patternUnits="userSpaceOnUse" id="pattern8" x="0" y="0" width="100" height="100">
     36        <g id="reuse2">
     37            <use xlink:href="#reuse"/>
     38            <use xlink:href="#use"/>
     39        </g>
     40    </pattern>
     41
     42    <pattern patternUnits="userSpaceOnUse" id="pattern9" x="0" y="0" width="100" height="100">
     43        <use xlink:href="#reuse2"/>
    2844    </pattern>
    2945</defs>
    3046
    31 <!-- This should not crash -->
    32 <rect x="0" y="0" width="100" height="100" fill="url(#pattern1)" stroke="green"/>
    33 <rect x="0" y="100" width="100" height="100" fill="url(#pattern2)" stroke="green"/>
    34 <rect x="100" y="0" width="100" height="100" fill="url(#pattern3)" stroke="green"/>
    35 <rect x="100" y="100" width="100" height="100" fill="url(#pattern4)" stroke="green"/>
    36 <rect x="0" y="200" width="100" height="100" fill="url(#pattern5)" stroke="green"/>
    37 <rect x="100" y="200" width="100" height="100" fill="url(#pattern6)" stroke="green"/>
    38 <rect x="0" y="300" width="100" height="100" fill="url(#pattern7)" stroke="green"/>
    39 <rect x="100" y="300" width="100" height="100" fill="url(#pattern8)" stroke="green"/>
     47<rect x="0" y="0" width="100" height="100" fill="url(#pattern1)"/>
     48<rect x="100" y="0" width="100" height="100" fill="url(#pattern2)"/>
     49<rect x="200" y="0" width="100" height="100" fill="url(#pattern3)"/>
     50<rect x="0" y="100" width="100" height="100" fill="url(#pattern4)"/>
     51<rect x="100" y="100" width="100" height="100" fill="url(#pattern5)"/>
     52<rect x="200" y="100" width="100" height="100" fill="url(#pattern6)"/>
     53<rect x="0" y="200" width="100" height="100" fill="url(#pattern7)"/>
     54<rect x="100" y="200" width="100" height="100" fill="url(#pattern8)"/>
     55<rect x="200" y="200" width="100" height="100" fill="url(#pattern9)"/>
     56
     57<line x1="325" x2="325" y1="0" y2="300" stroke="red"/>
     58<text text-anchor="middle" x="325" y="350">Both sides of the red line should look identical</text>
     59
     60<!-- This is the reference rendering -->
     61<g transform="translate(350,0)">
     62    <rect x="0" y="0" width="100" height="100" fill="url(#pattern0)"/>
     63    <rect x="100" y="0" width="100" height="100" fill="url(#pattern0)"/>
     64    <rect x="200" y="0" width="100" height="100" fill="url(#pattern0)"/>
     65    <rect x="0" y="100" width="100" height="100" fill="url(#pattern0)"/>
     66    <rect x="100" y="100" width="100" height="100" fill="url(#pattern0)"/>
     67    <rect x="200" y="100" width="100" height="100" fill="url(#pattern0)"/>
     68    <rect x="0" y="200" width="100" height="100" fill="url(#pattern0)"/>
     69    <rect x="100" y="200" width="100" height="100" fill="url(#pattern0)"/>
     70    <rect x="200" y="200" width="100" height="100" fill="url(#pattern0)"/>
     71</g>
    4072</svg>
  • trunk/WebCore/ChangeLog

    r64273 r64275  
     12010-07-29  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        WebKit shouldn't ignore resource cycles, but break them as Opera does
     6        https://bugs.webkit.org/show_bug.cgi?id=43031
     7
     8        mask images are not updated when render objects' bounds change
     9        https://bugs.webkit.org/show_bug.cgi?id=15124
     10
     11        SVG Gradients do not resize correctly
     12        https://bugs.webkit.org/show_bug.cgi?id=41902
     13
     14        svg/dynamic-updates: SVGMarkerElement markerHeight/Width tests are broken
     15        https://bugs.webkit.org/show_bug.cgi?id=42616
     16
     17        svg/dynamic-updates: SVGMaskElement tests are all broken
     18        https://bugs.webkit.org/show_bug.cgi?id=42617
     19
     20        Don't ignore resources containing cyclic references, but break them, as discussed on SVG WG mailing lists - to be compatible with Opera which already does that.
     21
     22        We used to lookup RenderSVGResourceContainers objects, by extracting the URI reference from the SVGRenderStyle, then utilizing getElementById() to lookup the
     23        node, and access its renderer. Opera ignores such references, if they point to resources that contain cyclic references. Ignoring them would mean we have
     24        to mutate the render style to empty the resource strings. That obviously doesn't work, as it would break expectations (getComputedStyle, etc.).
     25
     26        Introduce a SVGResources class that stores pointers to all resources, that can be applied to a RenderObject (clipper/filter/markers/masker).
     27        Add a SVGResourcesCache class, which is basically a HashMap<RenderObject*, SVGResources*>. Whenever a RenderObject receives style, we extract the URI references
     28        from the SVGRenderStyle, look up the RenderSVGResourceContainer* objects, and store them in a SVGResources* class. Then we execute a cycle detection logic,
     29        which detects cyclic references and breaks them. Breaking them means just nulling the pointer to the resource in the SVGResources object. Those SVGResources
     30        objects are cached, and used throughout the render tree to access resources. This way it's guaranteed that all cyclic references are resolved until layout/paint
     31        phase begins.
     32
     33        Add destroy/styleDidChange/updateFromElement methods to all SVG renderers, in order to keep track of resource/client changes in the SVGResourcesCache.
     34        As side-effect the SVGResourcesCache now knows which RenderObject references which resource, and thus can handle client registration for a RenderSVGResourceContainer.
     35        The RenderSVGResourceContainer now holds a HashSet of RenderObjects, that's always up2date, and not related to the fact wheter a resources has already been used
     36        for painting. The old logic missed to register clients for a resource, when the resource was in an invalid state. Fixing that fixes the svg/dynamic-updates/SVGMaskElement* tests.
     37
     38        Rewrite all svg/custom/recursive-(filter|gradient|mask|pattern).svg tests to contain a reference image how it should be renderered. All 1:1 compatible with Opera now.
     39
     40        * rendering/RenderForeignObject.cpp:
     41        (WebCore::RenderForeignObject::layout): Grab selfNeedsLayout() before calling RenderBlock::layout(), otherwhise it's always false.
     42        * rendering/RenderPath.cpp: Don't look up resources manually, use SVGResourcesCache.
     43        (WebCore::RenderPath::fillContains): Remove constness, to avoid the need to pass around const RenderObjects* to the SVGResourcesCache.
     44        (WebCore::RenderPath::strokeContains): Ditto.
     45        (WebCore::RenderPath::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/.
     46        (WebCore::RenderPath::calculateMarkerBoundsIfNeeded): Remove special client handling for markers, it's all unified now.
     47        (WebCore::RenderPath::styleWillChange): Only call setNeedsBoundariesUpdate when handling StyleDifferenceRepaint/Layout.
     48        * rendering/RenderPath.h:
     49        * rendering/RenderSVGBlock.cpp:
     50        (WebCore::RenderSVGBlock::destroy): Forward to SVGResourcesCache::clientDestroyed.
     51        (WebCore::RenderSVGBlock::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged.
     52        (WebCore::RenderSVGBlock::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
     53        * rendering/RenderSVGBlock.h:
     54        * rendering/RenderSVGContainer.cpp:
     55        (WebCore::RenderSVGContainer::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/.
     56        (WebCore::RenderSVGContainer::selfWillPaint): Don't look up resources manually, use SVGResourcesCache.
     57        * rendering/RenderSVGContainer.h:
     58        * rendering/RenderSVGGradientStop.cpp:
     59        (WebCore::RenderSVGGradientStop::styleDidChange): Rewrite, as invalidateResourceClients() is gone.
     60        * rendering/RenderSVGHiddenContainer.h: Make layout() protected, as RenderSVGResourceContainer overrides it.
     61        * rendering/RenderSVGImage.cpp:
     62        (WebCore::RenderSVGImage::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/.
     63        (WebCore::RenderSVGImage::destroy): Forward to SVGResourcesCache::clientDestroyed.
     64        (WebCore::RenderSVGImage::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged.
     65        (WebCore::RenderSVGImage::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
     66        (WebCore::RenderSVGImage::imageChanged): Don't look up resources manually, use SVGResourcesCache.
     67        * rendering/RenderSVGImage.h:
     68        * rendering/RenderSVGInline.cpp:
     69        (WebCore::RenderSVGInline::destroy): Forward to SVGResourcesCache::clientDestroyed.
     70        (WebCore::RenderSVGInline::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged.
     71        (WebCore::RenderSVGInline::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
     72        * rendering/RenderSVGInline.h:
     73        * rendering/RenderSVGModelObject.cpp:
     74        (WebCore::RenderSVGModelObject::destroy): Forward to SVGResourcesCache::clientDestroyed.
     75        (WebCore::RenderSVGModelObject::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged.
     76        (WebCore::RenderSVGModelObject::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
     77        * rendering/RenderSVGModelObject.h:
     78        * rendering/RenderSVGResource.cpp:
     79        (WebCore::RenderSVGResource::fillPaintingResource): Remove const from RenderObject parameter.
     80        (WebCore::RenderSVGResource::strokePaintingResource): Ditto.
     81        (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation): Early exit if we found the first parent resource.
     82        * rendering/RenderSVGResource.h:
     83        * rendering/RenderSVGResourceClipper.cpp:
     84        (WebCore::RenderSVGResourceClipper::~RenderSVGResourceClipper): Early exit if m_clipper is empty.
     85        (WebCore::RenderSVGResourceClipper::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer.
     86        (WebCore::RenderSVGResourceClipper::invalidateClient): Ditto.
     87        (WebCore::RenderSVGResourceClipper::applyResource): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore.
     88        (WebCore::RenderSVGResourceClipper::createClipData): Don't look up resources manually, use SVGResourcesCache.
     89        (WebCore::RenderSVGResourceClipper::hitTestClipContent): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore.
     90        * rendering/RenderSVGResourceClipper.h:
     91        * rendering/RenderSVGResourceContainer.cpp:
     92        (WebCore::svgExtensionsFromNode):
     93        (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer): Stop registering resource from the constructor, delegate to styleDidChange.
     94        (WebCore::RenderSVGResourceContainer::~RenderSVGResourceContainer): Only deregister resource if it was ever registered.
     95        (WebCore::RenderSVGResourceContainer::layout): invalidateClients() here, to avoid the need for invalidateResourceClients() in the SVG DOM. Just call setNeedsLayout() from the SVG DOM.
     96        (WebCore::RenderSVGResourceContainer::destroy): Forward to SVGResourcesCache::resourceDestroyed.
     97        (WebCore::RenderSVGResourceContainer::styleDidChange): Register resource not in the constructor but when it first receives style.
     98        (WebCore::RenderSVGResourceContainer::idChanged): Don't duplicate code, use existing methods from SVGResourcesCache.
     99        (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation): Add new helper function, to share code between all resources.
     100        (WebCore::RenderSVGResourceContainer::markClientForInvalidation): Ditto.
     101        (WebCore::RenderSVGResourceContainer::addClient): SVGResourcesCache now manages the list of clients. It calls addClient() for each RenderObject that uses this resource.
     102        (WebCore::RenderSVGResourceContainer::removeClient): SVGResourcesCache now manages the list of clients.
     103        (WebCore::RenderSVGResourceContainer::registerResource): New helper function sharing code between idChanged / styleDidChange.
     104        (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke): Add FIXME that the function is misplaced.
     105        * rendering/RenderSVGResourceContainer.h: Move most functions to the new RenderSVGResourceContainer.cpp file.
     106        * rendering/RenderSVGResourceFilter.cpp:
     107        (WebCore::RenderSVGResourceFilter::~RenderSVGResourceFilter): Early exit if m_filter is empty.
     108        (WebCore::RenderSVGResourceFilter::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer.
     109        (WebCore::RenderSVGResourceFilter::invalidateClient): Ditto.
     110        * rendering/RenderSVGResourceGradient.cpp:
     111        (WebCore::RenderSVGResourceGradient::~RenderSVGResourceGradient): Early exit if m_gradient is empty.
     112        (WebCore::RenderSVGResourceGradient::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer.
     113        (WebCore::RenderSVGResourceGradient::invalidateClient): Ditto.
     114        * rendering/RenderSVGResourceMarker.cpp:
     115        (WebCore::RenderSVGResourceMarker::~RenderSVGResourceMarker): Now a no-op, markers are unified within the new client handling concept, no more special code needed.
     116        (WebCore::RenderSVGResourceMarker::layout): As RenderSVGResourceMarker skips the RenderSVGResourceContainer::layout() method, we also need to call invalidateClients() here.
     117        (WebCore::RenderSVGResourceMarker::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer.
     118        (WebCore::RenderSVGResourceMarker::invalidateClient): Ditto.
     119        (WebCore::RenderSVGResourceMarker::draw): Remove marker specific logic to catch circular references.
     120        * rendering/RenderSVGResourceMarker.h:
     121        * rendering/RenderSVGResourceMasker.cpp:
     122        (WebCore::RenderSVGResourceMasker::~RenderSVGResourceMasker): Early exit if m_masker is empty.
     123        (WebCore::RenderSVGResourceMasker::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer.
     124        (WebCore::RenderSVGResourceMasker::invalidateClient): Ditto.
     125        (WebCore::RenderSVGResourceMasker::applyResource): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore.
     126        * rendering/RenderSVGResourceMasker.h:
     127        * rendering/RenderSVGResourcePattern.cpp:
     128        (WebCore::RenderSVGResourcePattern::~RenderSVGResourcePattern): Early exit if m_pattern is empty.
     129        (WebCore::RenderSVGResourcePattern::invalidateClients): Use new helper functions to invalidate clients, shared between all resources in RenderSVGResourceContainer.
     130        (WebCore::RenderSVGResourcePattern::invalidateClient): Ditto.
     131        (WebCore::RenderSVGResourcePattern::createTileImage): Remove containsCyclicReference() check, SVGResourcesCycleSolver breaks cyclic references, resources do not need to take care anymore.
     132        * rendering/RenderSVGResourcePattern.h:
     133        * rendering/RenderSVGRoot.cpp:
     134        (WebCore::RenderSVGRoot::selfWillPaint): Don't look up resources manually, use SVGResourcesCache.
     135        (WebCore::RenderSVGRoot::destroy): Forward to SVGResourcesCache::clientDestroyed.
     136        (WebCore::RenderSVGRoot::styleDidChange): Forward to SVGResourcesCache::clientStyleChanged.
     137        (WebCore::RenderSVGRoot::updateFromElement): Forward to SVGResourcesCache::clientUpdatedFromElement.
     138        * rendering/RenderSVGRoot.h:
     139        * rendering/RenderSVGText.cpp:
     140        (WebCore::RenderSVGText::layout): s/RenderSVGResource::invalidateAllResourcesOfRenderer/SVGResourcesCache::clientLayoutChanged/.
     141        * rendering/RenderSVGText.h:
     142        * rendering/SVGInlineTextBox.cpp:
     143        (WebCore::SVGInlineTextBox::acquirePaintingResource): Add RenderObject* parameter, don't assume the style comes from the InlineTextBox parent renderer.
     144        (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting): Pass the parent()->renderer() to acquirePaintingResource.
     145        (WebCore::SVGInlineTextBox::paintDecoration): Pass the decoration renderer to acquirePaintingResource.
     146        (WebCore::SVGInlineTextBox::paintDecorationWithStyle): Ditto.
     147        (WebCore::SVGInlineTextBox::paintText): When a selection pseudo style is used to paint the selection, swap styles in the SVGResourcesCache, to take the right resources when painting.
     148        * rendering/SVGInlineTextBox.h:
     149        * rendering/SVGRenderSupport.cpp:
     150        (WebCore::SVGRenderSupport::prepareToRenderSVGContent): Don't look up resources manually, use SVGResourcesCache.
     151        (WebCore::SVGRenderSupport::finishRenderSVGContent): Ditto.
     152        (WebCore::SVGRenderSupport::intersectRepaintRectWithResources): Ditto.
     153        (WebCore::SVGRenderSupport::pointInClippingArea): Remove const from RenderObject parameter.
     154        * rendering/SVGRenderSupport.h:
     155        * rendering/SVGRenderTreeAsText.cpp:
     156        (WebCore::writeStyle): Add two const_cast now that fill/strokePaintingResource take RenderObject* parameters. This was the less intrusive approach, otherwhise more const_casts would be needed.
     157        (WebCore::writeResources): Add FIXME that we should dump the resources present in the SVGResourcesCache instead of manually looking them up from the SVGRenderStyle, to avoid dumping cycles.
     158        * rendering/SVGResourcesCache.cpp:
     159        (WebCore::SVGResourcesCache::clientStyleChanged): Use markForLayoutAndParentResourceInvalidation() instead of duplicating code.
     160        * rendering/SVGResourcesCycleSolver.cpp:
     161        (WebCore::setFollowLinkForChainableResource): Implemented stub method.
     162        * rendering/style/SVGRenderStyle.cpp:
     163        (WebCore::SVGRenderStyle::diff): Return StyleDifferenceLayout, not Repaint for stroke paint changes, otherwhise the cached boundaries are not correctly updated.
     164        * svg/SVGClipPathElement.cpp:
     165        (WebCore::SVGClipPathElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     166        (WebCore::SVGClipPathElement::childrenChanged): Ditto.
     167        * svg/SVGClipPathElement.h:
     168        (WebCore::SVGClipPathElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
     169        * svg/SVGElement.cpp:
     170        (WebCore::SVGElement::insertedIntoDocument): Only execute buildPendingResource() logic, if needsPendingResourceHandling() returns true. Cleaned up code a bit, to deploy early returns.
     171        * svg/SVGElement.h:
     172        (WebCore::SVGElement::needsPendingResourceHandling): Return true (default). Only needed by SVGTextPathElement/SVGUseElement, and should be removed in future.
     173        * svg/SVGFilterElement.cpp:
     174        (WebCore::SVGFilterElement::SVGFilterElement): Initialize m_followLink=true.
     175        (WebCore::SVGFilterElement::setFilterRes): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     176        (WebCore::SVGFilterElement::svgAttributeChanged): Ditto.
     177        (WebCore::SVGFilterElement::childrenChanged): Ditto.
     178        * svg/SVGFilterElement.h:
     179        (WebCore::SVGFilterElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
     180        (WebCore::SVGFilterElement::setFollowLink): Used by SVGResourcesCycleSolver, to stop following xlink:href links, if that leads to cyclic references.
     181        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
     182        (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged): Don't use invalidateResourceClients(), it's a no-op as effects don't have a renderer -> use invalidateFilter().
     183        * svg/SVGFilterPrimitiveStandardAttributes.h:
     184        (WebCore::SVGFilterPrimitiveStandardAttributes::invalidateFilter): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     185        * svg/SVGGradientElement.cpp:
     186        (WebCore::SVGGradientElement::SVGGradientElement): Initialize m_followLink=true.
     187        (WebCore::SVGGradientElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     188        (WebCore::SVGGradientElement::childrenChanged): Ditto.
     189        * svg/SVGGradientElement.h:
     190        (WebCore::SVGGradientElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
     191        (WebCore::SVGGradientElement::setFollowLink): Used by SVGResourcesCycleSolver, to stop following xlink:href links, if that leads to cyclic references.
     192        * svg/SVGLinearGradientElement.cpp:
     193        (WebCore::SVGLinearGradientElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     194        (WebCore::SVGLinearGradientElement::collectGradientProperties): Only follow xlink:href links if m_followLinks == true.
     195        * svg/SVGMarkerElement.cpp:
     196        (WebCore::SVGMarkerElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     197        (WebCore::SVGMarkerElement::childrenChanged): Ditto.
     198        (WebCore::SVGMarkerElement::setOrientToAuto): Ditto.
     199        (WebCore::SVGMarkerElement::setOrientToAngle): Ditto.
     200        * svg/SVGMarkerElement.h:
     201        (WebCore::SVGMarkerElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
     202        * svg/SVGMaskElement.cpp:
     203        (WebCore::SVGMaskElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     204        (WebCore::SVGMaskElement::childrenChanged): Ditto.
     205        * svg/SVGMaskElement.h:
     206        (WebCore::SVGMaskElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
     207        * svg/SVGPatternElement.cpp:
     208        (WebCore::SVGPatternElement::SVGPatternElement): Initialize m_followLink=true.
     209        (WebCore::SVGPatternElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     210        (WebCore::SVGPatternElement::childrenChanged): Ditto.
     211        (WebCore::SVGPatternElement::collectPatternProperties): Only follow xlink:href links if m_followLinks == true.
     212        * svg/SVGPatternElement.h:
     213        (WebCore::SVGPatternElement::needsPendingResourceHandling): Return false, buildPendingResource() logic not needed anymore for resources, handled by RenderSVGResourceContainer.
     214        (WebCore::SVGPatternElement::setFollowLink): Used by SVGResourcesCycleSolver, to stop following xlink:href links, if that leads to cyclic references.
     215        * svg/SVGRadialGradientElement.cpp:
     216        (WebCore::SVGRadialGradientElement::svgAttributeChanged): Don't use invalidateResourceClients(), it's not needed anymore, only call setNeedsLayout() on the renderer.
     217        (WebCore::SVGRadialGradientElement::collectGradientProperties): Only follow xlink:href links if m_followLinks == true.
     218        * svg/SVGStyledElement.cpp:
     219        (WebCore::SVGStyledElement::attach): Call updateFromElement upon attach(), needed by all resource renderers. Defaults to a no-op in RenderObject.h
     220        * svg/SVGStyledElement.h: Remove invalidateResourceClients(), it's not needed anymore.
     221
    12222010-07-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    2223
  • trunk/WebCore/rendering/RenderForeignObject.cpp

    r63531 r64275  
    118118    // FIXME: Investigate in location rounding issues - only affects RenderForeignObject & RenderSVGText
    119119    setLocation(roundedIntPoint(viewportLocation));
     120
     121    bool layoutChanged = m_everHadLayout && selfNeedsLayout();
    120122    RenderBlock::layout();
     123    ASSERT(!needsLayout());
    121124
    122     // Invalidate all resources of this client, if we changed something.
    123     if (m_everHadLayout && selfNeedsLayout())
    124         RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     125    // Invalidate all resources of this client if our layout changed.
     126    if (layoutChanged)
     127        SVGResourcesCache::clientLayoutChanged(this);
    125128
    126129    repainter.repaintAfterLayout();
    127     setNeedsLayout(false);
    128130}
    129131
  • trunk/WebCore/rendering/RenderPath.cpp

    r63531 r64275  
    3636#include "RenderSVGContainer.h"
    3737#include "RenderSVGResourceMarker.h"
    38 #include "StrokeStyleApplier.h"
    3938#include "SVGRenderSupport.h"
     39#include "SVGResources.h"
    4040#include "SVGStyledTransformableElement.h"
    4141#include "SVGTransformList.h"
    4242#include "SVGURIReference.h"
     43#include "StrokeStyleApplier.h"
    4344#include <wtf/MathExtras.h>
    4445
     
    7374}
    7475
    75 bool RenderPath::fillContains(const FloatPoint& point, bool requiresFill, WindRule fillRule) const
     76bool RenderPath::fillContains(const FloatPoint& point, bool requiresFill, WindRule fillRule)
    7677{
    7778    if (!m_fillBoundingBox.contains(point))
     
    8485}
    8586
    86 bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke) const
     87bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke)
    8788{
    8889    if (!m_strokeAndMarkerBoundingBox.contains(point))
     
    112113    }
    113114
    114     // Invalidate all resources of this client, if we changed something.
     115    // Invalidate all resources of this client if our layout changed.
    115116    if (m_everHadLayout && selfNeedsLayout())
    116         RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     117        SVGResourcesCache::clientLayoutChanged(this);
    117118
    118119    // At this point LayoutRepainter already grabbed the old bounds,
     
    235236FloatRect RenderPath::calculateMarkerBoundsIfNeeded()
    236237{
    237     Document* doc = document();
    238 
    239238    SVGElement* svgElement = static_cast<SVGElement*>(node());
    240239    ASSERT(svgElement && svgElement->document());
     
    249248    ASSERT(svgStyle->hasMarkers());
    250249
    251     AtomicString startMarkerId(svgStyle->markerStartResource());
    252     AtomicString midMarkerId(svgStyle->markerMidResource());
    253     AtomicString endMarkerId(svgStyle->markerEndResource());
    254 
    255     RenderSVGResourceMarker* startMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(doc, startMarkerId);
    256     RenderSVGResourceMarker* midMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(doc, midMarkerId);
    257     RenderSVGResourceMarker* endMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(doc, endMarkerId);
    258 
    259     if (!startMarker && !startMarkerId.isEmpty())
    260         svgElement->document()->accessSVGExtensions()->addPendingResource(startMarkerId, styledElement);
    261     else if (startMarker)
    262         startMarker->addClient(this);
    263 
    264     if (!midMarker && !midMarkerId.isEmpty())
    265         svgElement->document()->accessSVGExtensions()->addPendingResource(midMarkerId, styledElement);
    266     else if (midMarker)
    267         midMarker->addClient(this);
    268 
    269     if (!endMarker && !endMarkerId.isEmpty())
    270         svgElement->document()->accessSVGExtensions()->addPendingResource(endMarkerId, styledElement);
    271     else if (endMarker)
    272         endMarker->addClient(this);
    273 
    274     if (!startMarker && !midMarker && !endMarker)
     250    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
     251    if (!resources)
    275252        return FloatRect();
    276253
     254    RenderSVGResourceMarker* markerStart = resources->markerStart();
     255    RenderSVGResourceMarker* markerMid = resources->markerMid();
     256    RenderSVGResourceMarker* markerEnd = resources->markerEnd();
     257    if (!markerStart && !markerMid && !markerEnd)
     258        return FloatRect();
     259
    277260    float strokeWidth = SVGRenderStyle::cssPrimitiveToLength(this, svgStyle->strokeWidth(), 1.0f);
    278     return m_markerLayoutInfo.calculateBoundaries(startMarker, midMarker, endMarker, strokeWidth, m_path);
     261    return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, strokeWidth, m_path);
    279262}
    280263
    281264void RenderPath::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
    282265{
    283     setNeedsBoundariesUpdate();
     266    if (diff == StyleDifferenceLayout)
     267        setNeedsBoundariesUpdate();
    284268    RenderSVGModelObject::styleWillChange(diff, newStyle);
    285269}
  • trunk/WebCore/rendering/RenderPath.h

    r60761 r64275  
    4848private:
    4949    // Hit-detection seperated for the fill and the stroke
    50     bool fillContains(const FloatPoint&, bool requiresFill = true, WindRule fillRule = RULE_NONZERO) const;
    51     bool strokeContains(const FloatPoint&, bool requiresStroke = true) const;
     50    bool fillContains(const FloatPoint&, bool requiresFill = true, WindRule fillRule = RULE_NONZERO);
     51    bool strokeContains(const FloatPoint&, bool requiresStroke = true);
    5252
    5353    virtual FloatRect objectBoundingBox() const { return m_fillBoundingBox; }
  • trunk/WebCore/rendering/RenderSVGBlock.cpp

    r61759 r64275  
    2626#include "RenderSVGBlock.h"
    2727
     28#include "RenderSVGResource.h"
    2829#include "SVGElement.h"
    2930
     
    7475    ASSERT_NOT_REACHED();
    7576}
     77
     78void RenderSVGBlock::destroy()
     79{
     80    SVGResourcesCache::clientDestroyed(this);
     81    RenderBlock::destroy();
     82}
     83
     84void RenderSVGBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
     85{
     86    RenderBlock::styleDidChange(diff, oldStyle);
     87    SVGResourcesCache::clientStyleChanged(this, diff, style());
     88}
     89
     90void RenderSVGBlock::updateFromElement()
     91{
     92    RenderBlock::updateFromElement();
     93    SVGResourcesCache::clientUpdatedFromElement(this, style());
     94}
     95
    7696}
    7797
  • trunk/WebCore/rendering/RenderSVGBlock.h

    r62118 r64275  
    3939
    4040    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
     41
     42    virtual void destroy();
     43    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     44    virtual void updateFromElement();
    4145};
    4246
  • trunk/WebCore/rendering/RenderSVGContainer.cpp

    r64007 r64275  
    3232#include "RenderView.h"
    3333#include "SVGRenderSupport.h"
     34#include "SVGResources.h"
    3435#include "SVGStyledElement.h"
    3536
     
    5960    SVGRenderSupport::layoutChildren(this, selfNeedsLayout());
    6061
    61     // Invalidate all resources of this client, if we changed something.
     62    // Invalidate all resources of this client if our layout changed.
    6263    if (m_everHadLayout && selfNeedsLayout())
    63         RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     64        SVGResourcesCache::clientLayoutChanged(this);
    6465
    6566    repainter.repaintAfterLayout();
     
    6768}
    6869
    69 bool RenderSVGContainer::selfWillPaint() const
     70bool RenderSVGContainer::selfWillPaint()
    7071{
    7172#if ENABLE(FILTERS)
    72     const SVGRenderStyle* svgStyle = style()->svgStyle();
    73     RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document(), svgStyle->filterResource());
    74     if (filter)
    75         return true;
     73    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
     74    return resources && resources->filter();
    7675#endif
    7776    return false;
  • trunk/WebCore/rendering/RenderSVGContainer.h

    r62531 r64275  
    7070    virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; }
    7171
    72     bool selfWillPaint() const;
     72    bool selfWillPaint();
    7373
    7474private:
  • trunk/WebCore/rendering/RenderSVGGradientStop.cpp

    r58212 r64275  
    2626#include "RenderSVGGradientStop.h"
    2727
     28#include "RenderSVGResourceContainer.h"
    2829#include "SVGGradientElement.h"
    2930#include "SVGNames.h"
     31#include "SVGResourcesCache.h"
    3032#include "SVGStopElement.h"
    3133
     
    4951    // <stop> elements should only be allowed to make renderers under gradient elements
    5052    // but I can imagine a few cases we might not be catching, so let's not crash if our parent isn't a gradient.
    51     if (SVGGradientElement* gradient = gradientElement())
    52         gradient->invalidateResourceClients();
     53    SVGGradientElement* gradient = gradientElement();
     54    if (!gradient)
     55        return;
     56
     57    RenderObject* renderer = gradient->renderer();
     58    if (!renderer)
     59        return;
     60
     61    ASSERT(renderer->isSVGResourceContainer());
     62    RenderSVGResourceContainer* container = renderer->toRenderSVGResourceContainer();
     63    container->invalidateClients();
    5364}
    5465
  • trunk/WebCore/rendering/RenderSVGHiddenContainer.h

    r64196 r64275  
    2525
    2626#if ENABLE(SVG)
    27 
    2827#include "RenderSVGContainer.h"
    2928
     
    4039        virtual const char* renderName() const { return "RenderSVGHiddenContainer"; }
    4140
     41    protected:
     42        virtual void layout();
     43
    4244    private:
    4345        virtual bool isSVGHiddenContainer() const { return true; }
    4446        virtual bool requiresLayer() const { return false; }
    4547
    46         virtual void layout();
    4748        virtual void paint(PaintInfo&, int parentX, int parentY);
    4849       
  • trunk/WebCore/rendering/RenderSVGImage.cpp

    r63531 r64275  
    4040#include "SVGPreserveAspectRatio.h"
    4141#include "SVGRenderSupport.h"
     42#include "SVGResources.h"
    4243
    4344namespace WebCore {
     
    7172    m_cachedLocalRepaintRect = FloatRect();
    7273
    73     // Invalidate all resources of this client, if we changed something.
     74    // Invalidate all resources of this client if our layout changed.
    7475    if (m_everHadLayout && selfNeedsLayout())
    75         RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     76        SVGResourcesCache::clientLayoutChanged(this);
    7677
    7778    repainter.repaintAfterLayout();
     
    111112void RenderSVGImage::destroy()
    112113{
    113     RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     114    SVGResourcesCache::clientDestroyed(this);
    114115    RenderImage::destroy();
     116}
     117
     118void RenderSVGImage::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
     119{
     120    RenderImage::styleDidChange(diff, oldStyle);
     121    SVGResourcesCache::clientStyleChanged(this, diff, style());
     122}
     123
     124void RenderSVGImage::updateFromElement()
     125{
     126    RenderImage::updateFromElement();
     127    SVGResourcesCache::clientUpdatedFromElement(this, style());
    115128}
    116129
     
    161174{
    162175    RenderImage::imageChanged(image, rect);
    163 #if ENABLE(FILTERS)
     176
    164177    // The image resource defaults to nullImage until the resource arrives.
    165     // This empty image may be cached by SVG filter effects which must be invalidated.
    166     if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document(), style()->svgStyle()->filterResource()))
    167         filter->invalidateClient(this);
    168 #endif
     178    // This empty image may be cached by SVG resources which must be invalidated.
     179    if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this))
     180        resources->invalidateClient(this);
     181
    169182    repaint();
    170183}
  • trunk/WebCore/rendering/RenderSVGImage.h

    r62118 r64275  
    6666
    6767    virtual void destroy();
     68    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     69    virtual void updateFromElement();
    6870
    6971    virtual bool requiresLayer() const { return false; }
  • trunk/WebCore/rendering/RenderSVGInline.cpp

    r62118 r64275  
    2727#include "RenderSVGInline.h"
    2828
     29#include "RenderSVGResource.h"
    2930#include "SVGInlineFlowBox.h"
    3031
     
    9394}
    9495
     96void RenderSVGInline::destroy()
     97{
     98    SVGResourcesCache::clientDestroyed(this);
     99    RenderInline::destroy();
     100}
     101
     102void RenderSVGInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
     103{
     104    RenderInline::styleDidChange(diff, oldStyle);
     105    SVGResourcesCache::clientStyleChanged(this, diff, style());
     106}
     107
     108void RenderSVGInline::updateFromElement()
     109{
     110    RenderInline::updateFromElement();
     111    SVGResourcesCache::clientUpdatedFromElement(this, style());
     112}
     113
    95114
    96115}
  • trunk/WebCore/rendering/RenderSVGInline.h

    r62118 r64275  
    5555private:
    5656    virtual InlineFlowBox* createInlineFlowBox();
     57
     58    virtual void destroy();
     59    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     60    virtual void updateFromElement();
    5761};
    5862
  • trunk/WebCore/rendering/RenderSVGModelObject.cpp

    r63531 r64275  
    8484void RenderSVGModelObject::destroy()
    8585{
    86     RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     86    SVGResourcesCache::clientDestroyed(this);
    8787    RenderObject::destroy();
    8888}
     
    9191{
    9292    RenderObject::styleDidChange(diff, oldStyle);
     93    SVGResourcesCache::clientStyleChanged(this, diff, style());
     94}
    9395
    94     if (style() && (diff == StyleDifferenceLayout || diff == StyleDifferenceRepaint))
    95         RenderSVGResource::markForLayoutAndParentResourceInvalidation(this, false);
     96void RenderSVGModelObject::updateFromElement()
     97{
     98    RenderObject::updateFromElement();
     99    SVGResourcesCache::clientUpdatedFromElement(this, style());
    96100}
    97101
  • trunk/WebCore/rendering/RenderSVGModelObject.h

    r63531 r64275  
    6363    virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
    6464    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     65    virtual void updateFromElement();
    6566
    6667private:
  • trunk/WebCore/rendering/RenderSVGResource.cpp

    r63531 r64275  
    2727#include "RenderSVGResource.h"
    2828
    29 #include "RenderSVGResourceClipper.h"
    3029#include "RenderSVGResourceContainer.h"
    31 #include "RenderSVGResourceFilter.h"
    32 #include "RenderSVGResourceMarker.h"
    33 #include "RenderSVGResourceMasker.h"
    3430#include "RenderSVGResourceSolidColor.h"
     31#include "SVGResources.h"
    3532#include "SVGURIReference.h"
    3633
    3734namespace WebCore {
    38 
    39 static inline void registerPendingResource(const AtomicString& id, const SVGPaint::SVGPaintType& paintType, const RenderObject* object)
    40 {
    41     if (paintType != SVGPaint::SVG_PAINTTYPE_URI)
    42         return;
    43 
    44     SVGElement* svgElement = static_cast<SVGElement*>(object->node());
    45     ASSERT(svgElement);
    46     ASSERT(svgElement->isStyled());
    47 
    48     object->document()->accessSVGExtensions()->addPendingResource(id, static_cast<SVGStyledElement*>(svgElement));
    49 }
    5035
    5136inline void RenderSVGResource::adjustColorForPseudoRules(const RenderStyle* style, bool useFillPaint, Color& color)
     
    7055
    7156// FIXME: This method and strokePaintingResource() should be refactored, to share even more code
    72 RenderSVGResource* RenderSVGResource::fillPaintingResource(const RenderObject* object, const RenderStyle* style)
     57RenderSVGResource* RenderSVGResource::fillPaintingResource(RenderObject* object, const RenderStyle* style)
    7358{
    7459    ASSERT(object);
     
    8570
    8671    SVGPaint::SVGPaintType paintType = fillPaint->paintType();
    87     if (paintType == SVGPaint::SVG_PAINTTYPE_URI
    88         || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR) {
    89         AtomicString id(SVGURIReference::getTarget(fillPaint->uri()));
    90         fillPaintingResource = getRenderSVGResourceContainerById(object->document(), id);
    91 
    92         if (!fillPaintingResource)
    93             registerPendingResource(id, paintType, object);
     72    if (paintType == SVGPaint::SVG_PAINTTYPE_URI || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR) {
     73        if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object))
     74            fillPaintingResource = resources->fill();
    9475    }
    9576
     
    123104}
    124105
    125 RenderSVGResource* RenderSVGResource::strokePaintingResource(const RenderObject* object, const RenderStyle* style)
     106RenderSVGResource* RenderSVGResource::strokePaintingResource(RenderObject* object, const RenderStyle* style)
    126107{
    127108    ASSERT(object);
     
    139120
    140121    SVGPaint::SVGPaintType paintType = strokePaint->paintType();
    141     if (!objectBoundingBox.isEmpty()
    142         && (paintType == SVGPaint::SVG_PAINTTYPE_URI || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)) {
    143         AtomicString id(SVGURIReference::getTarget(strokePaint->uri()));
    144         strokePaintingResource = getRenderSVGResourceContainerById(object->document(), id);
    145 
    146         if (!strokePaintingResource)
    147             registerPendingResource(id, paintType, object);
     122    if (!objectBoundingBox.isEmpty() && (paintType == SVGPaint::SVG_PAINTTYPE_URI || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)) {
     123        if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object))
     124            strokePaintingResource = resources->stroke();
    148125    }
    149126
     
    185162}
    186163
    187 void RenderSVGResource::markForLayoutAndResourceInvalidation(RenderObject* object, bool needsBoundariesUpdate)
    188 {
    189     ASSERT(object);
    190     ASSERT(object->node());
    191     ASSERT(object->node()->isSVGElement());
    192 
    193     // Eventually mark the renderer needing a boundaries update
    194     if (needsBoundariesUpdate)
    195         object->setNeedsBoundariesUpdate();
    196 
    197     markForLayoutAndParentResourceInvalidation(object);
    198 }
    199 
    200 static inline void invalidatePaintingResource(SVGPaint* paint, RenderObject* object)
    201 {
    202     ASSERT(paint);
    203 
    204     SVGPaint::SVGPaintType paintType = paint->paintType();
    205     if (paintType != SVGPaint::SVG_PAINTTYPE_URI && paintType != SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)
    206         return;
    207 
    208     AtomicString id(SVGURIReference::getTarget(paint->uri()));
    209     if (RenderSVGResourceContainer* paintingResource = getRenderSVGResourceContainerById(object->document(), id))
    210         paintingResource->invalidateClient(object);
    211 }
    212 
    213 void RenderSVGResource::invalidateAllResourcesOfRenderer(RenderObject* object)
    214 {
    215     ASSERT(object);
    216     ASSERT(object->style());
    217 
    218     Document* document = object->document();
    219     ASSERT(document);
    220 
    221     const SVGRenderStyle* svgStyle = object->style()->svgStyle();
    222     ASSERT(svgStyle);
    223 
    224     // Masker
    225     if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, svgStyle->maskerResource()))
    226         masker->invalidateClient(object);
    227 
    228     // Clipper
    229     if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, svgStyle->clipperResource()))
    230         clipper->invalidateClient(object);
    231 
    232     // Filter
    233 #if ENABLE(FILTERS)
    234     if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document, svgStyle->filterResource()))
    235         filter->invalidateClient(object);
    236 #endif
    237 
    238     // Markers
    239     if (RenderSVGResourceMarker* startMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(document, svgStyle->markerStartResource()))
    240         startMarker->invalidateClient(object);
    241     if (RenderSVGResourceMarker* midMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(document, svgStyle->markerMidResource()))
    242         midMarker->invalidateClient(object);
    243     if (RenderSVGResourceMarker* endMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(document, svgStyle->markerEndResource()))
    244         endMarker->invalidateClient(object);
    245 
    246     // Gradients/Patterns
    247     if (svgStyle->hasFill())
    248         invalidatePaintingResource(svgStyle->fillPaint(), object);
    249     if (svgStyle->hasStroke())
    250         invalidatePaintingResource(svgStyle->strokePaint(), object);
    251 }
    252 
    253164void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject* object, bool needsLayout)
    254165{
     
    260171    RenderObject* current = object->parent();
    261172    while (current) {
    262         if (current->isSVGResourceContainer())
     173        if (current->isSVGResourceContainer()) {
    263174            current->toRenderSVGResourceContainer()->invalidateClients();
     175            break;
     176        }
    264177
    265178        current = current->parent();
  • trunk/WebCore/rendering/RenderSVGResource.h

    r63531 r64275  
    2323
    2424#if ENABLE(SVG)
     25#include "RenderStyleConstants.h"
    2526#include "SVGDocumentExtensions.h"
    2627
     
    7677
    7778    // Helper utilities used in the render tree to access resources used for painting shapes/text (gradients & patterns only)
    78     static RenderSVGResource* fillPaintingResource(const RenderObject*, const RenderStyle*);
    79     static RenderSVGResource* strokePaintingResource(const RenderObject*, const RenderStyle*);
     79    static RenderSVGResource* fillPaintingResource(RenderObject*, const RenderStyle*);
     80    static RenderSVGResource* strokePaintingResource(RenderObject*, const RenderStyle*);
    8081    static RenderSVGResourceSolidColor* sharedSolidPaintingResource();
    8182
    82     static void invalidateAllResourcesOfRenderer(RenderObject*);
    8383    static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool needsLayout = true);
    8484
    8585private:
    8686    static void adjustColorForPseudoRules(const RenderStyle*, bool useFillPaint, Color&);
    87    
    88 protected:
    89     void markForLayoutAndResourceInvalidation(RenderObject*, bool needsBoundariesUpdate = true);
    9087};
    9188
  • trunk/WebCore/rendering/RenderSVGResourceClipper.cpp

    r63531 r64275  
    2222
    2323#include "config.h"
     24
    2425#if ENABLE(SVG)
    2526#include "RenderSVGResourceClipper.h"
     
    3334#include "IntRect.h"
    3435#include "RenderObject.h"
     36#include "RenderSVGResource.h"
    3537#include "RenderStyle.h"
    36 #include "RenderSVGResource.h"
    3738#include "SVGClipPathElement.h"
    3839#include "SVGElement.h"
    3940#include "SVGRenderSupport.h"
     41#include "SVGResources.h"
    4042#include "SVGStyledElement.h"
    4143#include "SVGStyledTransformableElement.h"
     
    5658RenderSVGResourceClipper::~RenderSVGResourceClipper()
    5759{
     60    if (m_clipper.isEmpty())
     61        return;
     62
    5863    deleteAllValues(m_clipper);
    5964    m_clipper.clear();
     
    6570        return;
    6671
    67     HashMap<RenderObject*, ClipperData*>::const_iterator end = m_clipper.end();
    68     for (HashMap<RenderObject*, ClipperData*>::const_iterator it = m_clipper.begin(); it != end; ++it)
    69         markForLayoutAndResourceInvalidation(it->first);
    70 
    71     deleteAllValues(m_clipper);
    72     m_clipper.clear();
    7372    m_clipBoundaries = FloatRect();
    74 }
    75 
    76 void RenderSVGResourceClipper::invalidateClient(RenderObject* object)
    77 {
     73    if (!m_clipper.isEmpty()) {
     74        deleteAllValues(m_clipper);
     75        m_clipper.clear();
     76    }
     77
     78    markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
     79}
     80
     81void RenderSVGResourceClipper::invalidateClient(RenderObject* client)
     82{
     83    ASSERT(client);
    7884    if (m_invalidationBlocked)
    7985        return;
    8086
    81     ASSERT(object);
    82     if (!m_clipper.contains(object))
    83         return;
    84 
    85     delete m_clipper.take(object);
    86     markForLayoutAndResourceInvalidation(object);
     87    ASSERT(client->selfNeedsLayout());
     88    if (m_clipper.contains(client))
     89        delete m_clipper.take(client);
     90
     91    markClientForInvalidation(client, BoundariesInvalidation);
    8792}
    8893
     
    96101    UNUSED_PARAM(resourceMode);
    97102#endif
    98 
    99     // Early exit, if this resource contains a child which references ourselves.
    100     if (containsCyclicReference(node()))
    101         return false;
    102103
    103104    applyClippingToContext(object, object->objectBoundingBox(), object->repaintRectInLocalCoordinates(), context);
     
    192193
    193194    // clipPath can also be clipped by another clipPath.
    194     if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(this->document(), style()->svgStyle()->clipperResource())) {
    195         if (!clipper->applyClippingToContext(this, objectBoundingBox, repaintRect, maskContext)) {
    196             maskContext->restore();
    197             return false;
    198         }           
     195    if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this)) {
     196        if (RenderSVGResourceClipper* clipper = resources->clipper()) {
     197            if (!clipper->applyClippingToContext(this, objectBoundingBox, repaintRect, maskContext)) {
     198                maskContext->restore();
     199                return false;
     200            }
     201        }
    199202    }
    200203
     
    281284bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundingBox, const FloatPoint& nodeAtPoint)
    282285{
    283     // FIXME: We should be able to check whether m_clipper.contains(object) - this doesn't work at the moment
    284     // as resourceBoundingBox() has already created ClipperData, even if applyResource() returned false.
    285     // Early exit, if this resource contains a child which references ourselves.
    286     if (containsCyclicReference(node()))
    287         return false;
    288 
    289286    FloatPoint point = nodeAtPoint;
    290287    if (!SVGRenderSupport::pointInClippingArea(this, point))
     
    311308
    312309    return false;
    313 }
    314 
    315 bool RenderSVGResourceClipper::childElementReferencesResource(const SVGRenderStyle* style, const String& referenceId) const
    316 {
    317     if (!style->hasClipper())
    318         return false;
    319 
    320     return style->clipperResource() == referenceId;
    321310}
    322311
  • trunk/WebCore/rendering/RenderSVGResourceClipper.h

    r63531 r64275  
    6969    void calculateClipContentRepaintRect();
    7070
    71     virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const;
    72 
    7371    bool m_invalidationBlocked;
    7472    FloatRect m_clipBoundaries;
  • trunk/WebCore/rendering/RenderSVGResourceContainer.cpp

    r64196 r64275  
    2929namespace WebCore {
    3030
     31static inline SVGDocumentExtensions* svgExtensionsFromNode(Node* node)
     32{
     33    ASSERT(node);
     34    ASSERT(node->document());
     35    return node->document()->accessSVGExtensions();
     36}
     37
    3138RenderSVGResourceContainer::RenderSVGResourceContainer(SVGStyledElement* node)
    3239    : RenderSVGHiddenContainer(node)
    33     , RenderSVGResource()
    3440    , m_id(node->hasID() ? node->getIdAttribute() : nullAtom)
     41    , m_registered(false)
    3542{
    36     ASSERT(node->document());
    37     node->document()->accessSVGExtensions()->addResource(m_id, this);
    3843}
    3944
    4045RenderSVGResourceContainer::~RenderSVGResourceContainer()
    4146{
    42     ASSERT(node());
    43     ASSERT(node()->document());
    44     node()->document()->accessSVGExtensions()->removeResource(m_id);
     47    if (m_registered)
     48        svgExtensionsFromNode(node())->removeResource(m_id);
     49}
     50
     51void RenderSVGResourceContainer::layout()
     52{
     53    // Invalidate all resources if our layout changed.
     54    if (m_everHadLayout && selfNeedsLayout())
     55        invalidateClients();
     56
     57    RenderSVGHiddenContainer::layout();
     58}
     59
     60void RenderSVGResourceContainer::destroy()
     61{
     62    SVGResourcesCache::resourceDestroyed(this);
     63    RenderSVGHiddenContainer::destroy();
     64}
     65
     66void RenderSVGResourceContainer::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
     67{
     68    RenderSVGHiddenContainer::styleDidChange(diff, oldStyle);
     69
     70    if (!m_registered) {
     71        m_registered = true;
     72        registerResource();
     73    }
    4574}
    4675
    4776void RenderSVGResourceContainer::idChanged()
    4877{
    49     ASSERT(node());
    50     ASSERT(node()->document());
    51     SVGDocumentExtensions* extensions = node()->document()->accessSVGExtensions();
     78    // Invalidate all our current clients.
     79    invalidateClients();
    5280
    53     // Remove old id, that is guaranteed to be present in cache
     81    // Remove old id, that is guaranteed to be present in cache.
     82    SVGDocumentExtensions* extensions = svgExtensionsFromNode(node());
    5483    extensions->removeResource(m_id);
    5584    m_id = static_cast<Element*>(node())->getIdAttribute();
    5685
    57     // It's possible that an element is referencing us with the new id, and has to be notified that we're existing now
    58     if (extensions->isPendingResource(m_id)) {
    59         OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id));
    60         if (clients->isEmpty())
    61             return;
     86    registerResource();
     87}
    6288
    63         HashSet<SVGStyledElement*>::const_iterator it = clients->begin();
    64         const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
     89void RenderSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode mode)
     90{
     91    if (m_clients.isEmpty())
     92        return;
    6593
    66         for (; it != end; ++it) {
    67             if (RenderObject* renderer = (*it)->renderer())
    68                 renderer->setNeedsLayout(true);
    69         }
     94    bool needsLayout = mode == LayoutAndBoundariesInvalidation;
     95
     96    HashSet<RenderObject*>::iterator end = m_clients.end();
     97    for (HashSet<RenderObject*>::iterator it = m_clients.begin(); it != end; ++it) {
     98        markClientForInvalidation(*it, mode);
     99        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*it, needsLayout);
     100    }
     101}
     102
     103void RenderSVGResourceContainer::markClientForInvalidation(RenderObject* client, InvalidationMode mode)
     104{
     105    ASSERT(client);
     106    ASSERT(!m_clients.isEmpty());
     107
     108    switch (mode) {
     109    case LayoutAndBoundariesInvalidation:
     110    case BoundariesInvalidation:
     111        client->setNeedsBoundariesUpdate();
     112        break;
     113    case RepaintInvalidation:
     114        if (client->view())
     115            client->repaint();
     116        break;
     117    }
     118}
     119
     120void RenderSVGResourceContainer::addClient(RenderObject* client)
     121{
     122    ASSERT(client);
     123    m_clients.add(client);
     124}
     125
     126void RenderSVGResourceContainer::removeClient(RenderObject* client)
     127{
     128    ASSERT(client);
     129    m_clients.remove(client);
     130}
     131
     132void RenderSVGResourceContainer::registerResource()
     133{
     134    SVGDocumentExtensions* extensions = svgExtensionsFromNode(node());
     135    if (!extensions->isPendingResource(m_id)) {
     136        extensions->addResource(m_id, this);
     137        return;
    70138    }
    71139
    72     // Recache us with the new id
     140    OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id));
     141
     142    // Cache us with the new id.
    73143    extensions->addResource(m_id, this);
     144
     145    // Update cached resources of pending clients.
     146    const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
     147    for (HashSet<SVGStyledElement*>::const_iterator it = clients->begin(); it != end; ++it) {
     148        RenderObject* renderer = (*it)->renderer();
     149        if (!renderer)
     150            continue;
     151        SVGResourcesCache::clientUpdatedFromElement(renderer, renderer->style());
     152        renderer->setNeedsLayout(true);
     153    }
    74154}
    75155
     156// FIXME: This does not belong here.
    76157AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderObject* object, const AffineTransform& resourceTransform)
    77158{
     
    85166}
    86167
    87 bool RenderSVGResourceContainer::containsCyclicReference(const Node* startNode) const
    88 {
    89     ASSERT(startNode->document());
    90 
    91     for (Node* node = startNode->firstChild(); node; node = node->nextSibling()) {
    92         if (!node->isSVGElement())
    93             continue;
    94 
    95         RenderObject* renderer = node->renderer();
    96         if (!renderer)
    97             continue;
    98 
    99         RenderStyle* style = renderer->style();
    100         if (!style)
    101             continue;
    102 
    103         const SVGRenderStyle* svgStyle = style->svgStyle();
    104         ASSERT(svgStyle);
    105 
    106         // Let the class inheriting from us decide whether the child element references ourselves.
    107         if (childElementReferencesResource(svgStyle, m_id))
    108             return true;
    109 
    110         // Dive into shadow tree to check for cycles there.
    111         if (node->hasTagName(SVGNames::useTag)) {
    112             ASSERT(renderer->isSVGShadowTreeRootContainer());
    113             if (Node* shadowRoot = static_cast<RenderSVGShadowTreeRootContainer*>(renderer)->rootElement()) {
    114                 if (containsCyclicReference(shadowRoot))
    115                     return true;
    116             }
    117 
    118         }
    119 
    120         if (node->hasChildNodes()) {
    121             if (containsCyclicReference(node))
    122                 return true;
    123         }
    124     }
    125 
    126     return false;
    127 }
    128 
    129168}
    130169
  • trunk/WebCore/rendering/RenderSVGResourceContainer.h

    r64196 r64275  
    2424#if ENABLE(SVG)
    2525#include "RenderSVGHiddenContainer.h"
    26 
    27 #include "SVGStyledTransformableElement.h"
    2826#include "RenderSVGResource.h"
    29 #include "RenderSVGShadowTreeRootContainer.h"
    3027
    3128namespace WebCore {
     
    3734    virtual ~RenderSVGResourceContainer();
    3835
    39     void idChanged();
     36    virtual void layout();
     37    virtual void destroy();
     38    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
    4039
    4140    virtual bool isSVGResourceContainer() const { return true; }
    4241    virtual bool drawsContents() { return false; }
    43 
    4442    virtual RenderSVGResourceContainer* toRenderSVGResourceContainer() { return this; }
    45     virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const { return false; }
    4643
    4744    static AffineTransform transformOnNonScalingStroke(RenderObject*, const AffineTransform& resourceTransform);
    4845
    49     bool containsCyclicReference(const Node* startNode) const;
     46    void idChanged();
     47
     48protected:
     49    enum InvalidationMode {
     50        LayoutAndBoundariesInvalidation,
     51        BoundariesInvalidation,
     52        RepaintInvalidation
     53    };
     54
     55    // Used from the invalidateClient/invalidateClients methods from classes, inheriting from us.
     56    void markAllClientsForInvalidation(InvalidationMode);
     57    void markClientForInvalidation(RenderObject*, InvalidationMode);
    5058
    5159private:
    5260    friend class SVGResourcesCache;
    53 
    54     // FIXME: No-ops for now, until follow-up patch on bug 43031 lands.
    55     void addClient(RenderObject*) { }
    56     void removeClient(RenderObject*) { }
     61    void addClient(RenderObject*);
     62    void removeClient(RenderObject*);
    5763
    5864private:
     65    void registerResource();
     66
    5967    AtomicString m_id;
     68    bool m_registered;
     69    HashSet<RenderObject*> m_clients;
    6070};
    6171
  • trunk/WebCore/rendering/RenderSVGResourceFilter.cpp

    r63531 r64275  
    6161RenderSVGResourceFilter::~RenderSVGResourceFilter()
    6262{
     63    if (m_filter.isEmpty())
     64        return;
     65
    6366    deleteAllValues(m_filter);
    6467    m_filter.clear();
     
    6770void RenderSVGResourceFilter::invalidateClients()
    6871{
    69     HashMap<RenderObject*, FilterData*>::const_iterator end = m_filter.end();
    70     for (HashMap<RenderObject*, FilterData*>::const_iterator it = m_filter.begin(); it != end; ++it)
    71         markForLayoutAndResourceInvalidation(it->first);
    72 
    73     deleteAllValues(m_filter);
    74     m_filter.clear();
    75 }
    76 
    77 void RenderSVGResourceFilter::invalidateClient(RenderObject* object)
    78 {
    79     ASSERT(object);
    80     if (!m_filter.contains(object))
    81         return;
    82 
    83     delete m_filter.take(object);
    84     markForLayoutAndResourceInvalidation(object);
     72    if (!m_filter.isEmpty()) {
     73        deleteAllValues(m_filter);
     74        m_filter.clear();
     75    }
     76
     77    markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
     78}
     79
     80void RenderSVGResourceFilter::invalidateClient(RenderObject* client)
     81{
     82    ASSERT(client);
     83    ASSERT(client->selfNeedsLayout());
     84
     85    if (m_filter.contains(client))
     86        delete m_filter.take(client);
     87
     88    markClientForInvalidation(client, BoundariesInvalidation);
    8589}
    8690
  • trunk/WebCore/rendering/RenderSVGResourceGradient.cpp

    r63542 r64275  
    4444RenderSVGResourceGradient::~RenderSVGResourceGradient()
    4545{
     46    if (m_gradient.isEmpty())
     47        return;
     48
    4649    deleteAllValues(m_gradient);
    4750    m_gradient.clear();
     
    5053void RenderSVGResourceGradient::invalidateClients()
    5154{
    52     const HashMap<RenderObject*, GradientData*>::const_iterator end = m_gradient.end();
    53     for (HashMap<RenderObject*, GradientData*>::const_iterator it = m_gradient.begin(); it != end; ++it)
    54         markForLayoutAndResourceInvalidation(it->first, false);
    55 
    56     deleteAllValues(m_gradient);
    57     m_gradient.clear();
    58 }
    59 
    60 void RenderSVGResourceGradient::invalidateClient(RenderObject* object)
    61 {
    62     ASSERT(object);
    63     if (!m_gradient.contains(object))
    64         return;
    65 
    66     delete m_gradient.take(object);
    67     markForLayoutAndResourceInvalidation(object, false);
     55    if (!m_gradient.isEmpty()) {
     56        deleteAllValues(m_gradient);
     57        m_gradient.clear();
     58    }
     59
     60    markAllClientsForInvalidation(RepaintInvalidation);
     61}
     62
     63void RenderSVGResourceGradient::invalidateClient(RenderObject* client)
     64{
     65    ASSERT(client);
     66    ASSERT(client->selfNeedsLayout());
     67
     68    if (m_gradient.contains(client))
     69        delete m_gradient.take(client);
     70
     71    markClientForInvalidation(client, RepaintInvalidation);
    6872}
    6973
  • trunk/WebCore/rendering/RenderSVGResourceMarker.cpp

    r63531 r64275  
    2222
    2323#include "config.h"
     24
    2425#if ENABLE(SVG)
    2526#include "RenderSVGResourceMarker.h"
     
    4445RenderSVGResourceMarker::~RenderSVGResourceMarker()
    4546{
    46     m_marker.clear();
    4747}
    4848
    4949void RenderSVGResourceMarker::layout()
    5050{
     51    // Invalidate all resources if our layout changed.
     52    if (m_everHadLayout && selfNeedsLayout())
     53        invalidateClients();
     54
    5155    // RenderSVGHiddenContainer overwrites layout(). We need the
    5256    // layouting of RenderSVGContainer for calculating  local
     
    5559}
    5660
    57 void RenderSVGResourceMarker::addClient(const RenderObject* object)
     61void RenderSVGResourceMarker::invalidateClients()
    5862{
    59     m_marker.add(object);
     63    markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
    6064}
    6165
    62 void RenderSVGResourceMarker::invalidateClients()
     66void RenderSVGResourceMarker::invalidateClient(RenderObject* client)
    6367{
    64     const HashSet<const RenderObject*>::const_iterator end = m_marker.end();
    65     for (HashSet<const RenderObject*>::const_iterator it = m_marker.begin(); it != end; ++it)
    66         markForLayoutAndResourceInvalidation(const_cast<RenderObject*>(*it));
    67 
    68     m_marker.clear();
    69 }
    70 
    71 void RenderSVGResourceMarker::invalidateClient(RenderObject* object)
    72 {
    73     ASSERT(object);
    74     if (!m_marker.contains(object))
    75         return;
    76 
    77     m_marker.remove(object);
    78     markForLayoutAndResourceInvalidation(object);
     68    ASSERT(client);
     69    ASSERT(client->selfNeedsLayout());
     70    markClientForInvalidation(client, BoundariesInvalidation);
    7971}
    8072
     
    141133void RenderSVGResourceMarker::draw(PaintInfo& paintInfo, const AffineTransform& transform)
    142134{
    143     DEFINE_STATIC_LOCAL(HashSet<RenderSVGResourceMarker*>, currentlyDrawingMarkers, ());
    144 
    145     // avoid drawing circular marker references
    146     if (currentlyDrawingMarkers.contains(this))
    147         return;
    148 
    149     currentlyDrawingMarkers.add(this);
    150135    PaintInfo info(paintInfo);
    151136    info.context->save();
     
    153138    RenderSVGContainer::paint(info, 0, 0);
    154139    info.context->restore();
    155 
    156     currentlyDrawingMarkers.remove(this);
    157140}
    158141
  • trunk/WebCore/rendering/RenderSVGResourceMarker.h

    r62104 r64275  
    4242    virtual const char* renderName() const { return "RenderSVGResourceMarker"; }
    4343
    44     void addClient(const RenderObject*);
    4544    virtual void invalidateClients();
    4645    virtual void invalidateClient(RenderObject*);
     
    7574    AffineTransform viewportTransform() const;
    7675
    77     // Save objects using this marker for invalidation.
    78     HashSet<const RenderObject*> m_marker;
    79 
    8076    mutable AffineTransform m_localToParentTransform;
    8177    FloatRect m_viewport;
  • trunk/WebCore/rendering/RenderSVGResourceMasker.cpp

    r63531 r64275  
    2020
    2121#include "config.h"
     22
    2223#if ENABLE(SVG)
    2324#include "RenderSVGResourceMasker.h"
     
    5253RenderSVGResourceMasker::~RenderSVGResourceMasker()
    5354{
     55    if (m_masker.isEmpty())
     56        return;
     57
    5458    deleteAllValues(m_masker);
    5559    m_masker.clear();
     
    5862void RenderSVGResourceMasker::invalidateClients()
    5963{
    60     HashMap<RenderObject*, MaskerData*>::const_iterator end = m_masker.end();
    61     for (HashMap<RenderObject*, MaskerData*>::const_iterator it = m_masker.begin(); it != end; ++it)
    62         markForLayoutAndResourceInvalidation(it->first);
    63 
    64     deleteAllValues(m_masker);
    65     m_masker.clear();
    6664    m_maskBoundaries = FloatRect();
    67 }
    68 
    69 void RenderSVGResourceMasker::invalidateClient(RenderObject* object)
    70 {
    71     ASSERT(object);
    72     if (!m_masker.contains(object))
    73         return;
    74 
    75     delete m_masker.take(object);
    76     markForLayoutAndResourceInvalidation(object);
    77 }
    78 
    79 bool RenderSVGResourceMasker::childElementReferencesResource(const SVGRenderStyle* style, const String& referenceId) const
    80 {
    81     if (!style->hasMasker())
    82         return false;
    83 
    84     return style->maskerResource() == referenceId;
     65    if (!m_masker.isEmpty()) {
     66        deleteAllValues(m_masker);
     67        m_masker.clear();
     68    }
     69
     70    markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
     71}
     72
     73void RenderSVGResourceMasker::invalidateClient(RenderObject* client)
     74{
     75    ASSERT(client);
     76    ASSERT(client->selfNeedsLayout());
     77
     78    if (m_masker.contains(client))
     79        delete m_masker.take(client);
     80
     81    markClientForInvalidation(client, BoundariesInvalidation);
    8582}
    8683
     
    103100        if (!maskElement)
    104101            return false;
    105 
    106         // Early exit, if this resource contains a child which references ourselves.
    107         if (containsCyclicReference(node()))
    108             return false;
    109 
    110102        createMaskImage(maskerData, maskElement, object);
    111103    }
  • trunk/WebCore/rendering/RenderSVGResourceMasker.h

    r63300 r64275  
    7070    void calculateMaskContentRepaintRect();
    7171
    72     virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const;
    73 
    7472    FloatRect m_maskBoundaries;
    7573    HashMap<RenderObject*, MaskerData*> m_masker;
  • trunk/WebCore/rendering/RenderSVGResourcePattern.cpp

    r63531 r64275  
    4141RenderSVGResourcePattern::~RenderSVGResourcePattern()
    4242{
     43    if (m_pattern.isEmpty())
     44        return;
     45
    4346    deleteAllValues(m_pattern);
    4447    m_pattern.clear();
     
    4750void RenderSVGResourcePattern::invalidateClients()
    4851{
    49     const HashMap<RenderObject*, PatternData*>::const_iterator end = m_pattern.end();
    50     for (HashMap<RenderObject*, PatternData*>::const_iterator it = m_pattern.begin(); it != end; ++it)
    51         markForLayoutAndResourceInvalidation(it->first, false);
    52 
    53     deleteAllValues(m_pattern);
    54     m_pattern.clear();
    55 }
    56 
    57 void RenderSVGResourcePattern::invalidateClient(RenderObject* object)
    58 {
    59     ASSERT(object);
    60     if (!m_pattern.contains(object))
    61         return;
    62 
    63     delete m_pattern.take(object);
    64     markForLayoutAndResourceInvalidation(object, false);
    65 }
    66 
    67 bool RenderSVGResourcePattern::childElementReferencesResource(const SVGRenderStyle* style, const String& referenceId) const
    68 {
    69     if (style->hasFill()) {
    70         if (style->fillPaint()->matchesTargetURI(referenceId))
    71             return true;
    72     }
    73 
    74     if (style->hasStroke()) {
    75         if (style->strokePaint()->matchesTargetURI(referenceId))
    76             return true;
    77     }
    78 
    79     return false;
     52    if (!m_pattern.isEmpty()) {
     53        deleteAllValues(m_pattern);
     54        m_pattern.clear();
     55    }
     56
     57    markAllClientsForInvalidation(RepaintInvalidation);
     58}
     59
     60void RenderSVGResourcePattern::invalidateClient(RenderObject* client)
     61{
     62    ASSERT(client);
     63    ASSERT(client->selfNeedsLayout());
     64
     65    if (m_pattern.contains(client))
     66        delete m_pattern.take(client);
     67
     68    markClientForInvalidation(client, RepaintInvalidation);
    8069}
    8170
     
    245234        return 0;
    246235
    247     // Early exit, if this resource contains a child which references ourselves.
    248     if (containsCyclicReference(attributes.patternContentElement()))
    249         return 0;
    250 
    251236    FloatRect objectBoundingBox = object->objectBoundingBox();   
    252237    FloatRect patternBoundaries = calculatePatternBoundaries(attributes, objectBoundingBox, patternElement);
  • trunk/WebCore/rendering/RenderSVGResourcePattern.h

    r63300 r64275  
    6868                                                          const AffineTransform& viewBoxCTM, const FloatRect& patternBoundaries) const;
    6969
    70     virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const;
    71 
    7270    HashMap<RenderObject*, PatternData*> m_pattern;
    7371};
  • trunk/WebCore/rendering/RenderSVGRoot.cpp

    r64272 r64275  
    3333#include "SVGLength.h"
    3434#include "SVGRenderSupport.h"
     35#include "SVGResources.h"
    3536#include "SVGSVGElement.h"
    3637#include "SVGStyledElement.h"
     
    130131}
    131132
    132 bool RenderSVGRoot::selfWillPaint() const
     133bool RenderSVGRoot::selfWillPaint()
    133134{
    134135#if ENABLE(FILTERS)
    135     const SVGRenderStyle* svgStyle = style()->svgStyle();
    136     RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document(), svgStyle->filterResource());
    137     if (filter)
    138         return true;
     136    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
     137    return resources && resources->filter();
    139138#endif
    140139    return false;
     
    193192void RenderSVGRoot::destroy()
    194193{
    195     RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     194    SVGResourcesCache::clientDestroyed(this);
    196195    RenderBox::destroy();
     196}
     197
     198void RenderSVGRoot::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
     199{
     200    RenderBox::styleDidChange(diff, oldStyle);
     201    SVGResourcesCache::clientStyleChanged(this, diff, style());
     202}
     203
     204void RenderSVGRoot::updateFromElement()
     205{
     206    RenderBox::updateFromElement();
     207    SVGResourcesCache::clientUpdatedFromElement(this, style());
    197208}
    198209
  • trunk/WebCore/rendering/RenderSVGRoot.h

    r62922 r64275  
    5959
    6060    virtual void destroy();
     61    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     62    virtual void updateFromElement();
    6163
    6264    virtual const AffineTransform& localToParentTransform() const;
     
    7880    void calcViewport();
    7981
    80     bool selfWillPaint() const;
     82    bool selfWillPaint();
    8183
    8284    IntSize parentOriginToBorderBox() const;
  • trunk/WebCore/rendering/RenderSVGText.cpp

    r63531 r64275  
    9999    forceLayoutInlineChildren();
    100100
    101     // Invalidate all resources of this client, if we changed something.
     101    // Invalidate all resources of this client if our layout changed.
    102102    if (m_everHadLayout && selfNeedsLayout())
    103         RenderSVGResource::invalidateAllResourcesOfRenderer(this);
     103        SVGResourcesCache::clientLayoutChanged(this);
    104104
    105105    repainter.repaintAfterLayout();
     
    131131
    132132    return false;
    133 }
    134 
    135 void RenderSVGText::destroy()
    136 {
    137     RenderSVGResource::invalidateAllResourcesOfRenderer(this);
    138     RenderSVGBlock::destroy();
    139133}
    140134
  • trunk/WebCore/rendering/RenderSVGText.h

    r61759 r64275  
    5252    virtual void layout();
    5353
    54     virtual void destroy();
    55 
    5654    virtual void absoluteQuads(Vector<FloatQuad>&);
    5755
  • trunk/WebCore/rendering/SVGInlineTextBox.cpp

    r62104 r64275  
    296296}
    297297
    298 bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, RenderStyle* style)
    299 {
     298bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, RenderObject* renderer, RenderStyle* style)
     299{
     300    ASSERT(renderer);
     301    ASSERT(style);
    300302    ASSERT(m_paintingResourceMode != ApplyToDefaultMode);
    301303
    302     RenderObject* parentRenderer = parent()->renderer();
    303     ASSERT(parentRenderer);
    304 
    305304    if (m_paintingResourceMode & ApplyToFillMode)
    306         m_paintingResource = RenderSVGResource::fillPaintingResource(parentRenderer, style);
     305        m_paintingResource = RenderSVGResource::fillPaintingResource(renderer, style);
    307306    else if (m_paintingResourceMode & ApplyToStrokeMode)
    308         m_paintingResource = RenderSVGResource::strokePaintingResource(parentRenderer, style);
     307        m_paintingResource = RenderSVGResource::strokePaintingResource(renderer, style);
    309308    else {
    310309        // We're either called for stroking or filling.
     
    315314        return false;
    316315
    317     m_paintingResource->applyResource(parentRenderer, style, context, m_paintingResourceMode);
     316    m_paintingResource->applyResource(renderer, style, context, m_paintingResourceMode);
    318317    return true;
    319318}
     
    332331bool SVGInlineTextBox::prepareGraphicsContextForTextPainting(GraphicsContext*& context, TextRun& textRun, RenderStyle* style)
    333332{
    334     bool acquiredResource = acquirePaintingResource(context, style);
     333    bool acquiredResource = acquirePaintingResource(context, parent()->renderer(), style);
    335334
    336335#if ENABLE(SVG_FONTS)
     
    509508    if (hasDecorationFill) {
    510509        m_paintingResourceMode = ApplyToFillMode;
    511         paintDecorationWithStyle(context, textOrigin, decorationStyle, decoration);
     510        paintDecorationWithStyle(context, textOrigin, decorationRenderer, decoration);
    512511    }
    513512
    514513    if (hasDecorationStroke) {
    515514        m_paintingResourceMode = ApplyToStrokeMode;
    516         paintDecorationWithStyle(context, textOrigin, decorationStyle, decoration);
    517     }
    518 }
    519 
    520 void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, const FloatPoint& textOrigin, RenderStyle* decorationStyle, ETextDecoration decoration)
     515        paintDecorationWithStyle(context, textOrigin, decorationRenderer, decoration);
     516    }
     517}
     518
     519void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, const FloatPoint& textOrigin, RenderObject* decorationRenderer, ETextDecoration decoration)
    521520{
    522521    ASSERT(!m_paintingResource);
    523522    ASSERT(m_paintingResourceMode != ApplyToDefaultMode);
    524523    ASSERT(m_currentChunkPart.isValid());
     524
     525    RenderStyle* decorationStyle = decorationRenderer->style();
     526    ASSERT(decorationStyle);
    525527
    526528    const Font& font = decorationStyle->font();
     
    535537    context->addPath(Path::createRectangle(FloatRect(x, y, m_currentChunkPart.width, thickness)));
    536538
    537     if (acquirePaintingResource(context, decorationStyle))
     539    if (acquirePaintingResource(context, decorationRenderer, decorationStyle))
    538540        releasePaintingResource(context);
    539541
     
    615617
    616618    // Draw text using selection style from the start to the end position of the selection
     619    if (style != selectionStyle)
     620        SVGResourcesCache::clientStyleChanged(parent()->renderer(), StyleDifferenceRepaint, selectionStyle);
     621
    617622    TextRun selectionTextRun(constructTextRun(selectionStyle));
    618623    paintTextWithShadows(context, textOrigin, selectionStyle, textRun, startPos, endPos);
     624
     625    if (style != selectionStyle)
     626        SVGResourcesCache::clientStyleChanged(parent()->renderer(), StyleDifferenceRepaint, style);
    619627
    620628    // Eventually draw text using regular style from the end position of the selection to the end of the current chunk part
  • trunk/WebCore/rendering/SVGInlineTextBox.h

    r62104 r64275  
    7676    AffineTransform buildChunkTransformation(SVGChar& firstCharacter) const;
    7777
    78     bool acquirePaintingResource(GraphicsContext*&, RenderStyle*);
     78    bool acquirePaintingResource(GraphicsContext*&, RenderObject*, RenderStyle*);
    7979    void releasePaintingResource(GraphicsContext*&);
    8080
     
    8484    void computeTextMatchMarkerRect(RenderStyle*);
    8585    void paintDecoration(GraphicsContext*, const FloatPoint& textOrigin, ETextDecoration, bool hasSelection);
    86     void paintDecorationWithStyle(GraphicsContext*, const FloatPoint& textOrigin, RenderStyle*, ETextDecoration);
     86    void paintDecorationWithStyle(GraphicsContext*, const FloatPoint& textOrigin, RenderObject*, ETextDecoration);
    8787    void paintSelection(GraphicsContext*, const FloatPoint& textOrigin, RenderStyle*);
    8888    void paintText(GraphicsContext*, const FloatPoint& textOrigin, RenderStyle*, RenderStyle* selectionStyle, bool hasSelection, bool paintSelectedTextOnly);
  • trunk/WebCore/rendering/SVGRenderSupport.cpp

    r62531 r64275  
    4141#include "RenderSVGResourceMasker.h"
    4242#include "RenderSVGRoot.h"
     43#include "SVGResources.h"
    4344#include "SVGStyledElement.h"
    4445#include "TransformState.h"
     
    8384    ASSERT(svgElement && svgElement->document() && svgElement->isStyled());
    8485
    85     SVGStyledElement* styledElement = static_cast<SVGStyledElement*>(svgElement);
    8686    RenderStyle* style = object->style();
    8787    ASSERT(style);
     
    110110    }
    111111
    112     Document* document = object->document();
    113 
    114     if (svgStyle->hasMasker()) {
    115         AtomicString maskerId(svgStyle->maskerResource());
    116         if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, maskerId)) {
    117             if (!masker->applyResource(object, style, paintInfo.context, ApplyToDefaultMode))
    118                 return false;
    119         } else
    120             document->accessSVGExtensions()->addPendingResource(maskerId, styledElement);
    121     }
    122 
    123     if (svgStyle->hasClipper()) {
    124         AtomicString clipperId(svgStyle->clipperResource());
    125         if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, clipperId))
    126             clipper->applyResource(object, style, paintInfo.context, ApplyToDefaultMode);
    127         else
    128             document->accessSVGExtensions()->addPendingResource(clipperId, styledElement);
    129     }
     112    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object);
     113    if (!resources)
     114        return true;
     115
     116    if (RenderSVGResourceMasker* masker = resources->masker()) {
     117        if (!masker->applyResource(object, style, paintInfo.context, ApplyToDefaultMode))
     118            return false;
     119    }
     120
     121    if (RenderSVGResourceClipper* clipper = resources->clipper())
     122        clipper->applyResource(object, style, paintInfo.context, ApplyToDefaultMode);
    130123
    131124#if ENABLE(FILTERS)
    132     if (svgStyle->hasFilter()) {
    133         AtomicString filterId(svgStyle->filterResource());
    134         if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document, filterId)) {
    135             if (!filter->applyResource(object, style, paintInfo.context, ApplyToDefaultMode))
    136                 return false;
    137         } else
    138             document->accessSVGExtensions()->addPendingResource(filterId, styledElement);
     125    if (RenderSVGResourceFilter* filter = resources->filter()) {
     126        if (!filter->applyResource(object, style, paintInfo.context, ApplyToDefaultMode))
     127            return false;
    139128    }
    140129#endif
     
    158147
    159148#if ENABLE(FILTERS)
    160     if (svgStyle->hasFilter()) {
    161         AtomicString filterId(svgStyle->filterResource());
    162         if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object->document(), filterId)) {
     149    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object);
     150    if (resources) {
     151        if (RenderSVGResourceFilter* filter = resources->filter()) {
    163152            filter->postApplyResource(object, paintInfo.context, ApplyToDefaultMode);
    164153            paintInfo.context = savedContext;
     
    290279{
    291280    ASSERT(object);
    292     ASSERT(object->style());
    293     const SVGRenderStyle* svgStyle = object->style()->svgStyle();
    294     if (!svgStyle)
     281
     282    RenderStyle* style = object->style();
     283    ASSERT(style);
     284
     285    const SVGRenderStyle* svgStyle = style->svgStyle();
     286    ASSERT(svgStyle);
     287
     288    RenderObject* renderer = const_cast<RenderObject*>(object);
     289    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer);
     290    if (!resources) {
     291        svgStyle->inflateForShadow(repaintRect);
    295292        return;
    296        
    297     RenderObject* renderer = const_cast<RenderObject*>(object);
     293    }
     294
    298295#if ENABLE(FILTERS)
    299     if (svgStyle->hasFilter()) {
    300         if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object->document(), svgStyle->filterResource()))
    301             repaintRect = filter->resourceBoundingBox(renderer);
    302     }
    303 #endif
    304 
    305     if (svgStyle->hasClipper()) {
    306         if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(object->document(), svgStyle->clipperResource()))
    307             repaintRect.intersect(clipper->resourceBoundingBox(renderer));
    308     }
    309    
    310     if (svgStyle->hasMasker()) {
    311         if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object->document(), svgStyle->maskerResource()))
    312             repaintRect.intersect(masker->resourceBoundingBox(renderer));
    313     }
    314    
     296    if (RenderSVGResourceFilter* filter = resources->filter())
     297        repaintRect = filter->resourceBoundingBox(renderer);
     298#endif
     299
     300    if (RenderSVGResourceClipper* clipper = resources->clipper())
     301        repaintRect.intersect(clipper->resourceBoundingBox(renderer));
     302
     303    if (RenderSVGResourceMasker* masker = resources->masker())
     304        repaintRect.intersect(masker->resourceBoundingBox(renderer));
     305
    315306    svgStyle->inflateForShadow(repaintRect);
    316307}
    317308
    318 bool SVGRenderSupport::pointInClippingArea(const RenderObject* object, const FloatPoint& point)
     309bool SVGRenderSupport::pointInClippingArea(RenderObject* object, const FloatPoint& point)
    319310{
    320311    ASSERT(object);
    321     ASSERT(object->style());
    322 
    323     Document* document = object->document();
    324     ASSERT(document);
    325 
    326     const SVGRenderStyle* svgStyle = object->style()->svgStyle();
     312
     313    RenderStyle* style = object->style();
     314    ASSERT(style);
     315
     316    const SVGRenderStyle* svgStyle = style->svgStyle();
    327317    ASSERT(svgStyle);
    328318
    329319    // We just take clippers into account to determine if a point is on the node. The Specification may
    330320    // change later and we also need to check maskers.
    331     if (svgStyle->hasClipper()) {
    332         if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, svgStyle->clipperResource()))
    333             return clipper->hitTestClipContent(object->objectBoundingBox(), point);
    334     }
     321    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object);
     322    if (!resources)
     323        return true;
     324
     325    if (RenderSVGResourceClipper* clipper = resources->clipper())
     326        return clipper->hitTestClipContent(object->objectBoundingBox(), point);
    335327
    336328    return true;
  • trunk/WebCore/rendering/SVGRenderSupport.h

    r62244 r64275  
    5757
    5858    // Determines whether the passed point lies in a clipping area
    59     static bool pointInClippingArea(const RenderObject*, const FloatPoint&);
     59    static bool pointInClippingArea(RenderObject*, const FloatPoint&);
    6060
    6161    enum ContainerBoundingBoxMode {
  • trunk/WebCore/rendering/SVGRenderTreeAsText.cpp

    r62118 r64275  
    367367        const RenderPath& path = static_cast<const RenderPath&>(object);
    368368
    369         if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(&path, path.style())) {
     369        if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(const_cast<RenderPath*>(&path), path.style())) {
    370370            TextStreamSeparator s(" ");
    371371            ts << " [stroke={" << s;
     
    388388        }
    389389
    390         if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(&path, path.style())) {
     390        if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(const_cast<RenderPath*>(&path), path.style())) {
    391391            TextStreamSeparator s(" ");
    392392            ts << " [fill={" << s;
     
    735735    const SVGRenderStyle* svgStyle = style->svgStyle();
    736736
     737    // FIXME: We want to use SVGResourcesCache to determine which resources are present, instead of quering the resource <-> id cache.
     738    // For now leave the DRT output as is, but later on we should change this so cycles are properly ignored in the DRT output.
    737739    RenderObject& renderer = const_cast<RenderObject&>(object);
    738740    if (!svgStyle->maskerResource().isEmpty()) {
  • trunk/WebCore/rendering/SVGResourcesCache.cpp

    r64196 r64275  
    132132
    133133    clientUpdatedFromElement(renderer, newStyle);
    134 
    135     // Invalidate resources in ancestor chain, if needed.
    136     RenderObject* parent = renderer->parent();
    137     while (parent) {
    138         if (parent->isSVGResourceContainer()) {
    139             parent->toRenderSVGResourceContainer()->invalidateClients();
    140             break;
    141         }
    142 
    143         parent = parent->parent();
    144     }
     134    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
    145135}
    146136 
  • trunk/WebCore/rendering/SVGResourcesCycleSolver.cpp

    r64196 r64275  
    112112}
    113113
    114 static inline void setFollowLinkForChainableResource(SVGElement*, bool)
    115 {
    116     // FIXME: Enable once the follow-up patch for bug 43031 lands
     114static inline void setFollowLinkForChainableResource(SVGElement* element, bool followLink)
     115{
     116    if (element->hasTagName(SVGNames::patternTag))
     117        static_cast<SVGPatternElement*>(element)->setFollowLink(followLink);
     118    else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTagName(SVGNames::radialGradientTag))
     119        static_cast<SVGGradientElement*>(element)->setFollowLink(followLink);
     120    else if (element->hasTagName(SVGNames::filterTag))
     121        static_cast<SVGFilterElement*>(element)->setFollowLink(followLink);
    117122}
    118123
  • trunk/WebCore/rendering/style/SVGRenderStyle.cpp

    r62259 r64275  
    166166    if (stroke != other->stroke) {
    167167        if (stroke->width != other->stroke->width
     168            || stroke->paint != other->stroke->paint
    168169            || stroke->miterLimit != other->stroke->miterLimit
    169170            || stroke->dashArray != other->stroke->dashArray
     
    171172            return StyleDifferenceLayout;
    172173
    173         // Only these two cases remain, where we only need a repaint.
    174         ASSERT(stroke->paint != other->stroke->paint || stroke->opacity != other->stroke->opacity);
     174        // Only the stroke-opacity case remains, where we only need a repaint.
     175        ASSERT(stroke->opacity != other->stroke->opacity);
    175176        return StyleDifferenceRepaint;
    176177    }
  • trunk/WebCore/svg/SVGClipPathElement.cpp

    r59773 r64275  
    7070    SVGStyledTransformableElement::svgAttributeChanged(attrName);
    7171
     72    RenderObject* object = renderer();
     73    if (!object)
     74        return;
     75
    7276    if (attrName == SVGNames::clipPathUnitsAttr ||
    7377        SVGTests::isKnownAttribute(attrName) ||
     
    7579        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
    7680        SVGStyledTransformableElement::isKnownAttribute(attrName))
    77         invalidateResourceClients();
     81        object->setNeedsLayout(true);
    7882}
    7983
     
    98102    SVGStyledTransformableElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
    99103
    100     if (!changedByParser)
    101         invalidateResourceClients();
     104    if (changedByParser)
     105        return;
     106
     107    if (RenderObject* object = renderer())
     108        object->setNeedsLayout(true);
    102109}
    103110
  • trunk/WebCore/svg/SVGClipPathElement.h

    r59773 r64275  
    4040
    4141    virtual bool isValid() const { return SVGTests::isValid(); }
     42    virtual bool needsPendingResourceHandling() const { return false; }
    4243
    4344    virtual void parseMappedAttribute(Attribute*);
  • trunk/WebCore/svg/SVGElement.cpp

    r62482 r64275  
    279279{
    280280    StyledElement::insertedIntoDocument();
     281
     282    if (!needsPendingResourceHandling())
     283        return;
     284
    281285    SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
    282 
    283286    String resourceId = getIdAttribute();
    284     if (extensions->isPendingResource(resourceId)) {
    285         OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(resourceId));
    286         if (clients->isEmpty())
    287             return;
    288 
    289         HashSet<SVGStyledElement*>::const_iterator it = clients->begin();
    290         const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
    291 
    292         for (; it != end; ++it)
    293             (*it)->buildPendingResource();
    294     }
     287    if (!extensions->isPendingResource(resourceId))
     288        return;
     289   
     290    OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(resourceId));
     291    if (clients->isEmpty())
     292        return;
     293
     294    const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
     295    for (HashSet<SVGStyledElement*>::const_iterator it = clients->begin(); it != end; ++it)
     296        (*it)->buildPendingResource();
    295297}
    296298
  • trunk/WebCore/svg/SVGElement.h

    r59773 r64275  
    9898
    9999        virtual ContainerNode* eventParentNode();
     100
     101        virtual bool needsPendingResourceHandling() const { return true; }
    100102        virtual void buildPendingResource() { }
    101103
  • trunk/WebCore/svg/SVGFilterElement.cpp

    r63809 r64275  
    4848    , SVGLangSpace()
    4949    , SVGExternalResourcesRequired()
     50    , m_followLink(true)
    5051    , m_filterUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
    5152    , m_primitiveUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
     
    6768    setFilterResXBaseValue(filterResX);
    6869    setFilterResYBaseValue(filterResY);
    69     invalidateResourceClients();
     70
     71    if (RenderObject* object = renderer())
     72        object->setNeedsLayout(true);
    7073}
    7174
     
    122125    }
    123126
     127    RenderObject* object = renderer();
     128    if (!object)
     129        return;
     130
    124131    if (invalidateClients
    125132        || attrName == SVGNames::filterUnitsAttr
     
    130137        || SVGLangSpace::isKnownAttribute(attrName)
    131138        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
    132         invalidateResourceClients();
     139        object->setNeedsLayout(true);
    133140}
    134141
     
    176183    SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
    177184
    178     if (!changedByParser)
    179         invalidateResourceClients();
     185    if (changedByParser)
     186        return;
     187
     188    if (RenderObject* object = renderer())
     189        object->setNeedsLayout(true);
    180190}
    181191
  • trunk/WebCore/svg/SVGFilterElement.h

    r63809 r64275  
    4444    virtual ~SVGFilterElement();
    4545
     46    virtual bool needsPendingResourceHandling() const { return false; }
     47
    4648    void setFilterRes(unsigned long filterResX, unsigned long filterResY);
    4749    FloatRect filterBoundingBox(const FloatRect&) const;
     
    5456    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    5557
     58    // FIXME: Add xlink:href support for filters, and use this property
     59    void setFollowLink(bool followLink) { m_followLink = followLink; }
     60
    5661private:
    5762    virtual bool selfHasRelativeLengths() const;
     63
     64    bool m_followLink;
    5865
    5966    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
  • trunk/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp

    r63883 r64275  
    108108
    109109    if (!changedByParser)
    110         invalidateResourceClients();
     110        invalidateFilter();
    111111}
    112112
  • trunk/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h

    r63883 r64275  
    5656        if (!inDocument() || !parentNode()->hasTagName(SVGNames::filterTag))
    5757            return;
    58         static_cast<SVGFilterElement*>(parentNode())->invalidateResourceClients();
     58        if (RenderObject* object = parentNode()->renderer())
     59            object->setNeedsLayout(true);
    5960    }
    6061
  • trunk/WebCore/svg/SVGGradientElement.cpp

    r59773 r64275  
    4343    , SVGURIReference()
    4444    , SVGExternalResourcesRequired()
     45    , m_followLink(true)
    4546    , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
    4647    , m_gradientTransform(SVGTransformList::create(SVGNames::gradientTransformAttr))
     
    8687    SVGStyledElement::svgAttributeChanged(attrName);
    8788
     89    RenderObject* object = renderer();
     90    if (!object)
     91        return;
     92
    8893    if (attrName == SVGNames::gradientUnitsAttr
    8994        || attrName == SVGNames::gradientTransformAttr
     
    9297        || SVGExternalResourcesRequired::isKnownAttribute(attrName)
    9398        || SVGStyledElement::isKnownAttribute(attrName))
    94         invalidateResourceClients();
     99        object->setNeedsLayout(true);
    95100}
    96101
     
    124129    SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
    125130
    126     if (!changedByParser)
    127         invalidateResourceClients();
     131    if (changedByParser)
     132        return;
     133
     134    if (RenderObject* object = renderer())
     135        object->setNeedsLayout(true);
    128136}
    129137
  • trunk/WebCore/svg/SVGGradientElement.h

    r59773 r64275  
    3838        virtual ~SVGGradientElement();
    3939
     40        virtual bool needsPendingResourceHandling() const { return false; }
     41
    4042        virtual void parseMappedAttribute(Attribute*);
    4143        virtual void svgAttributeChanged(const QualifiedName&);
     
    4648        Vector<Gradient::ColorStop> buildStops();
    4749 
     50        void setFollowLink(bool followLink) { m_followLink = followLink; }
     51
    4852    protected:
     53        bool m_followLink;
     54
    4955        DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::spreadMethodAttr, int, SpreadMethod, spreadMethod)
    5056        DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::gradientUnitsAttr, int, GradientUnits, gradientUnits)
  • trunk/WebCore/svg/SVGLinearGradientElement.cpp

    r62488 r64275  
    7777        || attrName == SVGNames::y2Attr) {
    7878        updateRelativeLengthsInformation();
    79         invalidateResourceClients();
     79
     80        RenderObject* object = renderer();
     81        if (!object)
     82            return;
     83
     84        object->setNeedsLayout(true);
    8085    }
    8186}
     
    151156
    152157        // Respect xlink:href, take attributes from referenced element
    153         Node* refNode = ownerDocument()->getElementById(SVGURIReference::getTarget(current->href()));
     158        Node* refNode = m_followLink ? ownerDocument()->getElementById(SVGURIReference::getTarget(current->href())) : 0;
    154159        if (refNode && (refNode->hasTagName(SVGNames::linearGradientTag) || refNode->hasTagName(SVGNames::radialGradientTag))) {
    155160            current = static_cast<SVGGradientElement*>(refNode);
    156161
    157162            // Cycle detection
    158             if (processedGradients.contains(current))
    159                 return LinearGradientAttributes();
     163            if (processedGradients.contains(current)) {
     164                current = 0;
     165                break;
     166            }
    160167
    161168            isLinear = current->hasTagName(SVGNames::linearGradientTag);
  • trunk/WebCore/svg/SVGMarkerElement.cpp

    r62488 r64275  
    114114    }
    115115
     116    RenderObject* object = renderer();
     117    if (!object)
     118        return;
     119
    116120    if (invalidateClients
    117121        || attrName == SVGNames::markerUnitsAttr
     
    121125        || SVGFitToViewBox::isKnownAttribute(attrName)
    122126        || SVGStyledElement::isKnownAttribute(attrName))
    123         invalidateResourceClients();
     127        object->setNeedsLayout(true);
    124128}
    125129
     
    167171    SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
    168172
    169     if (!changedByParser)
    170         invalidateResourceClients();
     173    if (changedByParser)
     174        return;
     175
     176    if (RenderObject* object = renderer())
     177        object->setNeedsLayout(true);
    171178}
    172179
     
    176183    setOrientAngleBaseValue(SVGAngle());
    177184
    178     invalidateResourceClients();
     185    if (RenderObject* object = renderer())
     186        object->setNeedsLayout(true);
    179187}
    180188
     
    184192    setOrientAngleBaseValue(angle);
    185193
    186     invalidateResourceClients();
     194    if (RenderObject* object = renderer())
     195        object->setNeedsLayout(true);
    187196}
    188197
  • trunk/WebCore/svg/SVGMarkerElement.h

    r62488 r64275  
    5757    virtual ~SVGMarkerElement();
    5858
     59    virtual bool needsPendingResourceHandling() const { return false; }
     60
    5961    AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const;
    6062
  • trunk/WebCore/svg/SVGMaskElement.cpp

    r64197 r64275  
    103103    }
    104104
     105    RenderObject* object = renderer();
     106    if (!object)
     107        return;
     108
    105109    if (invalidateClients
    106110        || attrName == SVGNames::maskUnitsAttr
     
    110114        || SVGExternalResourcesRequired::isKnownAttribute(attrName)
    111115        || SVGStyledElement::isKnownAttribute(attrName))
    112         invalidateResourceClients();
     116        object->setNeedsLayout(true);
    113117}
    114118
     
    142146    SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
    143147
    144     if (!changedByParser)
    145         invalidateResourceClients();
     148    if (changedByParser)
     149        return;
     150
     151    if (RenderObject* object = renderer())
     152        object->setNeedsLayout(true);
    146153}
    147154
  • trunk/WebCore/svg/SVGMaskElement.h

    r64197 r64275  
    4141
    4242        virtual bool isValid() const { return SVGTests::isValid(); }
     43        virtual bool needsPendingResourceHandling() const { return false; }
    4344
    4445        FloatRect maskBoundingBox(const FloatRect&) const;
  • trunk/WebCore/svg/SVGPatternElement.cpp

    r62488 r64275  
    5757    , SVGExternalResourcesRequired()
    5858    , SVGFitToViewBox()
     59    , m_followLink(true)
    5960    , m_x(LengthModeWidth)
    6061    , m_y(LengthModeHeight)
     
    130131    }
    131132
     133    RenderObject* object = renderer();
     134    if (!object)
     135        return;
     136
    132137    if (invalidateClients
    133138        || attrName == SVGNames::patternUnitsAttr
     
    140145        || SVGFitToViewBox::isKnownAttribute(attrName)
    141146        || SVGStyledElement::isKnownAttribute(attrName))
    142         invalidateResourceClients();
     147        object->setNeedsLayout(true);
    143148}
    144149
     
    189194    SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
    190195
    191     if (!changedByParser)
    192         invalidateResourceClients();
     196    if (changedByParser)
     197        return;
     198
     199    if (RenderObject* object = renderer())
     200        object->setNeedsLayout(true);
    193201}
    194202
     
    232240
    233241        // Respect xlink:href, take attributes from referenced element
    234         Node* refNode = ownerDocument()->getElementById(SVGURIReference::getTarget(current->href()));
     242        Node* refNode = m_followLink ? ownerDocument()->getElementById(SVGURIReference::getTarget(current->href())) : 0;
    235243        if (refNode && refNode->hasTagName(SVGNames::patternTag)) {
    236244            current = static_cast<const SVGPatternElement*>(const_cast<const Node*>(refNode));
    237245
    238246            // Cycle detection
    239             if (processedPatterns.contains(current))
    240                 return PatternAttributes();
     247            if (processedPatterns.contains(current)) {
     248                current = 0;
     249                break;
     250            }
    241251        } else
    242252            current = 0;
  • trunk/WebCore/svg/SVGPatternElement.h

    r62488 r64275  
    4848       
    4949        virtual bool isValid() const { return SVGTests::isValid(); }
     50        virtual bool needsPendingResourceHandling() const { return false; }
    5051
    5152        virtual void parseMappedAttribute(Attribute*);
     
    5758
    5859        PatternAttributes collectPatternProperties() const;
     60        void setFollowLink(bool followLink) { m_followLink = followLink; }
    5961
    6062    private:
    6163        virtual bool selfHasRelativeLengths() const;
     64
     65        bool m_followLink;
    6266
    6367        DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::xAttr, SVGLength, X, x)
  • trunk/WebCore/svg/SVGRadialGradientElement.cpp

    r62488 r64275  
    8484        || attrName == SVGNames::rAttr) {
    8585        updateRelativeLengthsInformation();
    86         invalidateResourceClients();
     86       
     87        RenderObject* object = renderer();
     88        if (!object)
     89            return;
     90
     91        object->setNeedsLayout(true);
    8792    }
    8893}
     
    164169
    165170        // Respect xlink:href, take attributes from referenced element
    166         Node* refNode = ownerDocument()->getElementById(SVGURIReference::getTarget(current->href()));
     171        Node* refNode = m_followLink ? ownerDocument()->getElementById(SVGURIReference::getTarget(current->href())) : 0;
    167172        if (refNode && (refNode->hasTagName(SVGNames::radialGradientTag) || refNode->hasTagName(SVGNames::linearGradientTag))) {
    168173            current = static_cast<SVGGradientElement*>(refNode);
    169174
    170175            // Cycle detection
    171             if (processedGradients.contains(current))
    172                 return RadialGradientAttributes();
     176            if (processedGradients.contains(current)) {
     177                current = 0;
     178                break;
     179            }
    173180
    174181            isRadial = current->hasTagName(SVGNames::radialGradientTag);
  • trunk/WebCore/svg/SVGStyledElement.cpp

    r63531 r64275  
    259259}
    260260
    261 void SVGStyledElement::invalidateResourceClients()
    262 {
    263     if (document()->parsing())
    264         return;
    265 
    266     RenderObject* object = renderer();
    267     if (!object)
    268         return;
    269 
    270     if (object->isSVGResourceContainer())
    271         object->toRenderSVGResourceContainer()->invalidateClients();
     261void SVGStyledElement::attach()
     262{
     263    SVGElement::attach();
     264
     265    if (RenderObject* object = renderer())
     266        object->updateFromElement();
    272267}
    273268
  • trunk/WebCore/svg/SVGStyledElement.h

    r63531 r64275  
    5858        virtual void synchronizeProperty(const QualifiedName&);
    5959
     60        virtual void attach();
    6061        virtual void insertedIntoDocument();
    6162        virtual void removedFromDocument();
     
    6465        // Centralized place to force a manual style resolution. Hacky but needed for now.
    6566        PassRefPtr<RenderStyle> resolveStyle(RenderStyle* parentStyle);
    66 
    67         void invalidateResourceClients();
    6867
    6968        bool instanceUpdatesBlocked() const;
Note: See TracChangeset for help on using the changeset viewer.