Changeset 60689 in webkit
- Timestamp:
- Jun 4, 2010 11:02:13 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r60685 r60689 1 2010-06-04 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVG filter on filter don't work 6 https://bugs.webkit.org/show_bug.cgi?id=32708 7 8 Test that a filter can be used by the text root as well as on it's childs. 9 10 * platform/mac/svg/filters/filter-on-filter-for-text-expected.checksum: Added. 11 * platform/mac/svg/filters/filter-on-filter-for-text-expected.png: Added. 12 * platform/mac/svg/filters/filter-on-filter-for-text-expected.txt: Added. 13 * svg/filters/filter-on-filter-for-text.svg: Added. 14 1 15 2010-06-04 Alexey Proskuryakov <ap@apple.com> 2 16 -
trunk/WebCore/ChangeLog
r60688 r60689 1 2010-06-04 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVG filter on filter don't work 6 https://bugs.webkit.org/show_bug.cgi?id=32708 7 8 Any child of <text> was not allowed to use the same filter as the text root. 9 I couldn't found any reason in the SVG specification that legimitate this. 10 Only batik also doesn't allow the same filter on the text root as on it's childs, 11 while any other effect is still allowed. 12 I removed this limitation so that the result looks like the result on Firefox. 13 14 Test: svg/filters/filter-on-filter-for-text.svg 15 16 * rendering/SVGRenderSupport.cpp: 17 (WebCore::SVGRenderBase::prepareToRenderSVGContent): 18 * rendering/SVGRenderSupport.h: 19 * rendering/SVGRootInlineBox.cpp: 20 (WebCore::SVGRootInlineBoxPaintWalker::SVGRootInlineBoxPaintWalker): 21 (WebCore::SVGRootInlineBoxPaintWalker::chunkStartCallback): 22 (WebCore::SVGRootInlineBox::paint): 23 1 24 2010-06-04 Nate Chapin <japhet@chromium.org> 2 25 -
trunk/WebCore/rendering/SVGRenderSupport.cpp
r60541 r60689 82 82 } 83 83 84 bool SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& repaintRect, RenderSVGResourceFilter*& filter , RenderSVGResourceFilter* rootFilter)84 bool SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& repaintRect, RenderSVGResourceFilter*& filter) 85 85 { 86 86 #if !ENABLE(FILTERS) … … 100 100 ASSERT(svgStyle); 101 101 102 // Setup transparency layers before setting up filters!102 // Setup transparency layers before setting up SVG resources! 103 103 float opacity = style->opacity(); 104 104 if (opacity < 1.0f) { … … 113 113 } 114 114 115 Document* document = object->document(); 116 117 if (svgStyle->hasMasker()) { 118 AtomicString maskerId(svgStyle->maskerResource()); 119 if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, maskerId)) { 120 if (!masker->applyResource(object, style, paintInfo.context, ApplyToDefaultMode)) 121 return false; 122 } else 123 svgElement->document()->accessSVGExtensions()->addPendingResource(maskerId, styledElement); 124 } 125 126 if (svgStyle->hasClipper()) { 127 AtomicString clipperId(svgStyle->clipperResource()); 128 if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, clipperId)) 129 clipper->applyResource(object, style, paintInfo.context, ApplyToDefaultMode); 130 else 131 svgElement->document()->accessSVGExtensions()->addPendingResource(clipperId, styledElement); 132 } 133 115 134 #if ENABLE(FILTERS) 116 AtomicString filterId(svgStyle->filterResource()); 117 #endif 118 119 AtomicString clipperId(svgStyle->clipperResource()); 120 AtomicString maskerId(svgStyle->maskerResource()); 121 122 Document* document = object->document(); 123 124 #if ENABLE(FILTERS) 125 RenderSVGResourceFilter* newFilter = getRenderSVGResourceById<RenderSVGResourceFilter>(document, filterId); 126 if (newFilter == rootFilter) { 127 // Catch <text filter="url(#foo)">Test<tspan filter="url(#foo)">123</tspan></text>. 128 // The filter is NOT meant to be applied twice in that case! 129 filter = 0; 130 filterId = String(); 131 } else 132 filter = newFilter; 133 #endif 134 135 if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, maskerId)) { 136 if (!masker->applyResource(object, style, paintInfo.context, ApplyToDefaultMode)) 137 return false; 138 } else if (!maskerId.isEmpty()) 139 svgElement->document()->accessSVGExtensions()->addPendingResource(maskerId, styledElement); 140 141 if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, clipperId)) 142 clipper->applyResource(object, style, paintInfo.context, ApplyToDefaultMode); 143 else if (!clipperId.isEmpty()) 144 svgElement->document()->accessSVGExtensions()->addPendingResource(clipperId, styledElement); 145 146 #if ENABLE(FILTERS) 147 if (filter) { 148 if (!filter->applyResource(object, style, paintInfo.context, ApplyToDefaultMode)) 149 return false; 150 } else if (!filterId.isEmpty()) 151 svgElement->document()->accessSVGExtensions()->addPendingResource(filterId, styledElement); 135 if (svgStyle->hasFilter()) { 136 AtomicString filterId(svgStyle->filterResource()); 137 filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document, filterId); 138 if (filter) { 139 if (!filter->applyResource(object, style, paintInfo.context, ApplyToDefaultMode)) 140 return false; 141 } else 142 svgElement->document()->accessSVGExtensions()->addPendingResource(filterId, styledElement); 143 } 152 144 #endif 153 145 -
trunk/WebCore/rendering/SVGRenderSupport.h
r60541 r60689 47 47 // It's unclear if these should be exposed or not. SVGRootInlineBox may 48 48 // pass the wrong RenderObject* and boundingBox to these functions. 49 static bool prepareToRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, RenderSVGResourceFilter*& , RenderSVGResourceFilter* rootFilter = 0);49 static bool prepareToRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, RenderSVGResourceFilter*&); 50 50 static void finishRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, RenderSVGResourceFilter*&, GraphicsContext* savedContext); 51 51 -
trunk/WebCore/rendering/SVGRootInlineBox.cpp
r59589 r60689 74 74 // Helper class for paint() 75 75 struct SVGRootInlineBoxPaintWalker { 76 SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, Render SVGResourceFilter* rootFilter, RenderObject::PaintInfo paintInfo, int tx, int ty)76 SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, RenderObject::PaintInfo paintInfo, int tx, int ty) 77 77 : m_rootBox(rootBox) 78 78 , m_chunkStarted(false) … … 81 81 , m_boundingBox(tx + rootBox->x(), ty + rootBox->y(), rootBox->width(), rootBox->height()) 82 82 , m_filter(0) 83 , m_rootFilter(rootFilter)84 83 , m_fillPaintingResource(0) 85 84 , m_strokePaintingResource(0) … … 144 143 // FIXME: Why is this done here instead of in RenderSVGText? 145 144 if (!flowBox->isRootInlineBox()) 146 SVGRenderBase::prepareToRenderSVGContent(object, m_paintInfo, m_boundingBox, m_filter , m_rootFilter);145 SVGRenderBase::prepareToRenderSVGContent(object, m_paintInfo, m_boundingBox, m_filter); 147 146 } 148 147 … … 404 403 FloatRect m_boundingBox; 405 404 RenderSVGResourceFilter* m_filter; 406 RenderSVGResourceFilter* m_rootFilter;407 405 408 406 RenderSVGResource* m_fillPaintingResource; … … 432 430 if (SVGRenderBase::prepareToRenderSVGContent(renderer(), paintInfo, boundingBox, filter)) { 433 431 // Render text, chunk-by-chunk 434 SVGRootInlineBoxPaintWalker walkerCallback(this, filter,paintInfo, tx, ty);432 SVGRootInlineBoxPaintWalker walkerCallback(this, paintInfo, tx, ty); 435 433 SVGTextChunkWalker<SVGRootInlineBoxPaintWalker> walker(&walkerCallback, 436 434 &SVGRootInlineBoxPaintWalker::chunkPortionCallback,
Note: See TracChangeset
for help on using the changeset viewer.