haikuwebkit/LayoutTests/svg/filters/feImage-filterUnits-objectB...

31 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

<feImage> doesn't work with local references when using primitiveUnits="objectBoundingBox" https://bugs.webkit.org/show_bug.cgi?id=77205 Reviewed by Antti Koivisto. Source/WebCore: Consider following testcase: <svg width="1000" height="500"> <defs> <circle id="c" cx="50%" cy="50%" r="10%"/> <filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" primitiveUnits="objectBoundingBox"> <feImage xlink:href="#c"/> </filter> </defs> <rect width="100" height="100" filter="url(#f)"/> </svg> The <svg> has a viewport of 1000x50. The <circle> in the <defs> element is resolved as <circle cx="500" cy="250" r="79"/>, as the context for this element (looking at it isolated!) is the viewport of the <svg>. We then setup a 0x0 - 100x100 rect in user space, which gets filtered, by a filter, also defined in user space (for simplicity), but with primitiveUnits="objectBoundingBox". That means that the default subregion of the filter effect <feImage/> which has no inputs, is defined in the SVG 1.1 spec to be equal to the filter region, which is 0x0-100x100 in user space. This <feImage/> is supposed to produce a 100x100 image, containing a circle in the middle (aka. <circle cx="50" cy="50".../>), but it doesn't, as the <circle> it's trying to paint, is laid out at 500x250, and thus outside the 100x100 sized image buffer. So how to resolve this? The RenderSVGShape thats owned by the <circle> generates its Path value by calling cx().value(lengthContext) and the SVGLengthContext here resolves to the <svg>. That happens on _layout_. If we would want to change the SVGLengthContext in this case (what I originally planned!) to carry a custom 100x100 viewport, we'd need to relayout. Unfortunately this is not an option, as this would mean that SVGImageBufferTools::renderSubtreeToImageBuffer, would need to relayout its children first, but we produce the filter images when painting. This is very dangerous and has just recently been fixed so that SVGImageBufferTools can ASSERT(!item->needsLayout()) when painting the subtree to an image buffer. The only sane solution I see, that does not require relayouts, is to make a map between the <circle> bounding box in user space (500x250 center point) to the filter primitive subregion space (here: 100x100 center point), and concat that transformation before painting the subtree to the image buffer. Of course this approach only works if all values of the <circle> are relative. If someone uses <circle id="c" cx="50%" cy="666"> the transformation that I'm looking for is undefined. We'd really need to create a new Path here, to resolve only cx against the new viewport, and not cy. Though in practice it turns out this is not a problem. All use cases of feImage + primitiveUnits="objectBoundingBox" link to elements that are completely defined in percentual values, as this is really the only thing which makes sense - otherwise you can always switch back to primtiveUnits="userSpaceOnUse". Anyhow, I'm going to fix all known wild-life test cases by my approach, and say we don't support using mixed length units when referencing those elements from feImages with primitiveUnits="objectBoundingBox". Adding lots of new testcases, trying all the different feImage modes. Tests: svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-position.svg svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg svg/filters/feImage-subregions-preseveAspectRatio-none.svg svg/filters/feImage-subregions.svg * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Reverse logic, simplifying the code a bit. Remove FEImage special cases (absoluteSubregion). * svg/SVGLengthContext.h: Make determineViewport() public, for use in FEImage. * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Don't apply preserveAspectRatio transformation for local elements, it's not defined and breaks content. (WebCore::FEImage::platformApplySoftware): Figure out the absolute subregion by utilizing filterPrimitiveSubregion() as FETurbulence does. Map between filter primitive subregion and target object space for primitiveUnits="objectBoundingBox" support on SVG element references. * svg/graphics/filters/SVGFEImage.h: Remove absoluteSubregion member & setter, it's no longer needed. LayoutTests: Add new test cases covering all combinations of filterUnits/primitiveUnits and <feImage>. * platform/chromium/test_expectations.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-position-expected.png: Added. * platform/mac/svg/filters/feImage-position-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-position.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none.svg: Added. * svg/filters/feImage-subregions.svg: Added. * svg/filters/resources/green.png: Added. Canonical link: https://commits.webkit.org/94091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-27 13:54:21 +00:00
layer at (0,0) size 800x800
RenderView at (0,0) size 785x585
layer at (0,0) size 800x800
RenderSVGRoot {svg} at (0,0) size 370x370
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
Add new renderer for circles and ellipses https://bugs.webkit.org/show_bug.cgi?id=80423 Patch by Philip Rogers <pdr@google.com> on 2012-03-30 Reviewed by Eric Seidel. Source/WebCore: This patch introduces a special renderer for SVGCircleElements and SVGEllipseElements to avoid having to use the slower path rendering code. This patch includes optimized circle code for the CG platform, and hooks (GC::fillEllipse, GC::strokeEllipse) are available for other platforms as well. Tests: svg/hittest/svg-ellipse-non-scale-stroke.xhtml svg/hittest/svg-ellipse.xhtml Added a test to exercise hit testing on an ellipse, and on an ellipse's stroke, to make sure the formulae in this patch are correct. * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::fillEllipse): (WebCore): (WebCore::GraphicsContext::strokeEllipse): (WebCore::GraphicsContext::fillEllipseAsPath): (WebCore::GraphicsContext::strokeEllipseAsPath): (WebCore::GraphicsContext::platformFillEllipse): (WebCore::GraphicsContext::platformStrokeEllipse): * platform/graphics/GraphicsContext.h: (GraphicsContext): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::platformFillEllipse): (WebCore): (WebCore::GraphicsContext::platformStrokeEllipse): * platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContext::platformFillEllipse): (WebCore): (WebCore::GraphicsContext::platformStrokeEllipse): * rendering/svg/RenderSVGAllInOne.cpp: * rendering/svg/RenderSVGEllipse.cpp: Added. (WebCore): (WebCore::RenderSVGEllipse::RenderSVGEllipse): (WebCore::RenderSVGEllipse::~RenderSVGEllipse): (WebCore::RenderSVGEllipse::createShape): (WebCore::RenderSVGEllipse::calculateRadiiAndCenter): (WebCore::RenderSVGEllipse::objectBoundingBox): (WebCore::RenderSVGEllipse::strokeBoundingBox): (WebCore::RenderSVGEllipse::fillShape): (WebCore::RenderSVGEllipse::strokeShape): (WebCore::RenderSVGEllipse::shapeDependentStrokeContains): (WebCore::RenderSVGEllipse::shapeDependentFillContains): * rendering/svg/RenderSVGEllipse.h: Added. (WebCore): (RenderSVGEllipse): (WebCore::RenderSVGEllipse::isSVGEllipse): (WebCore::RenderSVGEllipse::renderName): (WebCore::RenderSVGEllipse::isEmpty): * svg/SVGCircleElement.cpp: (WebCore::SVGCircleElement::svgAttributeChanged): (WebCore): (WebCore::SVGCircleElement::createRenderer): * svg/SVGCircleElement.h: (SVGCircleElement): * svg/SVGEllipseElement.cpp: (WebCore::SVGEllipseElement::svgAttributeChanged): (WebCore::SVGEllipseElement::createRenderer): (WebCore): * svg/SVGEllipseElement.h: (SVGEllipseElement): LayoutTests: * platform/chromium/test_expectations.txt: * platform/gtk/Skipped: * platform/mac/Skipped: * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/filters-felem-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/linking-uri-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/struct-use-11-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/styling-pres-02-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-21-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-23-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-26-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-28-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-29-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-30-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-31-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-32-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-33-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-37-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-39-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-44-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-80-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-81-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-82-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-83-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/color-prop-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/color-prop-02-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/color-prop-03-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/coords-units-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/coords-units-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-felem-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-offset-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/interact-cursor-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/interact-order-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/interact-order-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/interact-zoom-01-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/linking-a-04-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/linking-a-05-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/linking-uri-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/linking-uri-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/metadata-example-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/painting-marker-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/painting-render-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/script-handle-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/script-handle-03-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/script-handle-04-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/shapes-circle-01-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/shapes-circle-02-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/shapes-ellipse-01-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/shapes-ellipse-02-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/shapes-intro-01-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/struct-frag-02-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/struct-frag-03-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/struct-frag-04-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/struct-use-01-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/styling-css-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/styling-css-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/styling-css-03-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/styling-inherit-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/styling-pres-01-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-align-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-align-05-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/types-basicDOM-01-b-expected.txt: * platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t-expected.txt: * platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-02-t-expected.txt: * platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-03-t-expected.txt: * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt: * platform/mac/svg/as-image/img-preserveAspectRatio-support-2-expected.txt: * platform/mac/svg/as-object/object-box-sizing-no-width-height-expected.txt: * platform/mac/svg/as-object/svg-embedded-in-html-in-iframe-expected.txt: * platform/mac/svg/batik/masking/maskRegions-expected.txt: * platform/mac/svg/batik/paints/patternPreserveAspectRatioA-expected.txt: * platform/mac/svg/batik/paints/patternRegions-expected.txt: * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt: * platform/mac/svg/batik/text/verticalText-expected.txt: * platform/mac/svg/carto.net/button-expected.txt: * platform/mac/svg/clip-path/clip-in-mask-expected.txt: * platform/mac/svg/clip-path/clip-path-child-clipped-expected.txt: * platform/mac/svg/clip-path/clip-path-evenodd-nonzero-expected.txt: * platform/mac/svg/clip-path/clip-path-nonzero-evenodd-expected.txt: * platform/mac/svg/clip-path/clip-path-nonzero-expected.txt: * platform/mac/svg/clip-path/clip-path-pixelation-expected.txt: * platform/mac/svg/clip-path/clip-path-transform-1-expected.txt: * platform/mac/svg/clip-path/clip-path-use-as-child2-expected.txt: * platform/mac/svg/clip-path/clip-path-use-as-child3-expected.txt: * platform/mac/svg/clip-path/clip-path-use-as-child4-expected.txt: * platform/mac/svg/clip-path/clip-path-use-as-child5-expected.txt: * platform/mac/svg/clip-path/clip-path-with-different-unittypes-expected.txt: * platform/mac/svg/clip-path/clip-path-with-different-unittypes2-expected.txt: * platform/mac/svg/clip-path/deep-nested-clip-in-mask-different-unitTypes-expected.txt: * platform/mac/svg/clip-path/deep-nested-clip-in-mask-expected.txt: * platform/mac/svg/clip-path/deep-nested-clip-in-mask-panning-expected.txt: * platform/mac/svg/clip-path/nested-clip-in-mask-image-based-clipping-expected.txt: * platform/mac/svg/clip-path/nested-clip-in-mask-path-and-image-based-clipping-expected.txt: * platform/mac/svg/clip-path/nested-clip-in-mask-path-based-clipping-expected.txt: * platform/mac/svg/css/shadow-changes-expected.txt: * platform/mac/svg/custom/absolute-sized-content-with-resources-expected.txt: * platform/mac/svg/custom/circle-move-invalidation-expected.txt: * platform/mac/svg/custom/circular-marker-reference-2-expected.txt: * platform/mac/svg/custom/clone-element-with-animated-svg-properties-expected.txt: * platform/mac/svg/custom/dasharrayOrigin-expected.txt: * platform/mac/svg/custom/focus-ring-expected.txt: * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt: * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt: * platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt: * platform/mac/svg/custom/inline-svg-in-xhtml-expected.txt: * platform/mac/svg/custom/invalid-css-expected.txt: * platform/mac/svg/custom/linking-a-03-b-all-expected.txt: * platform/mac/svg/custom/linking-a-03-b-preserveAspectRatio-expected.txt: * platform/mac/svg/custom/linking-a-03-b-transform-expected.txt: * platform/mac/svg/custom/linking-a-03-b-viewBox-expected.txt: * platform/mac/svg/custom/linking-a-03-b-viewBox-transform-expected.txt: * platform/mac/svg/custom/linking-a-03-b-viewTarget-expected.txt: * platform/mac/svg/custom/linking-a-03-b-zoomAndPan-expected.txt: * platform/mac/svg/custom/linking-uri-01-b-expected.txt: * platform/mac/svg/custom/marker-opacity-expected.txt: * platform/mac/svg/custom/mask-colorspace-expected.txt: * platform/mac/svg/custom/mask-on-multiple-objects-expected.txt: * platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt: * platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.txt: * platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt: * platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.txt: * platform/mac/svg/custom/non-circular-marker-reference-expected.txt: * platform/mac/svg/custom/object-sizing-expected.txt: * platform/mac/svg/custom/object-sizing-explicit-height-expected.txt: * platform/mac/svg/custom/object-sizing-explicit-width-expected.txt: * platform/mac/svg/custom/object-sizing-explicit-width-height-expected.txt: * platform/mac/svg/custom/object-sizing-no-width-height-expected.txt: * platform/mac/svg/custom/path-zero-strokewidth-expected.txt: * platform/mac/svg/custom/pattern-incorrect-tiling-expected.txt: * platform/mac/svg/custom/pattern-no-pixelation-expected.txt: * platform/mac/svg/custom/pattern-referencing-preserve-aspect-ratio-expected.txt: * platform/mac/svg/custom/pattern-rotate-expected.txt: * platform/mac/svg/custom/relative-sized-content-with-resources-expected.txt: * platform/mac/svg/custom/shapes-supporting-markers-expected.txt: * platform/mac/svg/custom/stroked-pattern-expected.txt: * platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.txt: * platform/mac/svg/custom/use-css-events-expected.txt: * platform/mac/svg/custom/use-detach-expected.txt: * platform/mac/svg/custom/use-elementInstance-methods-expected.txt: * platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt: * platform/mac/svg/custom/use-modify-container-in-target-expected.txt: * platform/mac/svg/custom/use-modify-target-container-expected.txt: * platform/mac/svg/custom/use-on-g-containing-use-expected.txt: * platform/mac/svg/custom/use-on-g-expected.txt: * platform/mac/svg/custom/use-on-use-expected.txt: * platform/mac/svg/custom/use-transform-expected.txt: * platform/mac/svg/custom/width-full-percentage-expected.txt: * platform/mac/svg/filters/feDropShadow-expected.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: * platform/mac/svg/filters/feImage-late-indirect-update-expected.txt: * platform/mac/svg/hixie/cascade/001-broken-expected.txt: * platform/mac/svg/hixie/cascade/002-expected.txt: * platform/mac/svg/hixie/error/001-expected.txt: * platform/mac/svg/hixie/error/003-expected.txt: * platform/mac/svg/hixie/error/017-expected.txt: * platform/mac/svg/hixie/mixed/003-expected.txt: * platform/mac/svg/hixie/mixed/004-expected.txt: * platform/mac/svg/hixie/mixed/005-expected.txt: * platform/mac/svg/hixie/mixed/006-expected.txt: * platform/mac/svg/hixie/mixed/008-expected.txt: * platform/mac/svg/hixie/mixed/011-expected.txt: * platform/mac/svg/hixie/perf/001-expected.txt: * platform/mac/svg/hixie/perf/002-expected.txt: * platform/mac/svg/hixie/perf/007-expected.txt: * platform/mac/svg/hixie/rendering-model/001-expected.txt: * platform/mac/svg/hixie/rendering-model/002-expected.txt: * platform/mac/svg/hixie/shapes/path/001-expected.txt: * platform/mac/svg/hixie/transform/001-expected.txt: * platform/mac/svg/in-html/circle-expected.txt: * platform/mac/svg/stroke/zero-length-arc-linecaps-rendering-expected.txt: * platform/mac/svg/stroke/zero-length-path-linecap-rendering-expected.txt: * platform/mac/svg/stroke/zero-length-subpaths-linecap-rendering-expected.txt: * platform/mac/svg/text/small-fonts-3-expected.txt: * platform/mac/svg/text/text-align-01-b-expected.txt: * platform/mac/svg/text/text-align-05-b-expected.txt: * platform/mac/svg/text/text-fill-opacity-expected.txt: * platform/mac/svg/transforms/svg-css-transforms-clip-path-expected.txt: * platform/mac/svg/wicd/rightsizing-grid-expected.txt: * platform/mac/svg/wicd/test-rightsizing-b-expected.txt: * platform/mac/svg/zoom/page/zoom-hixie-mixed-008-expected.txt: * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt: * platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt: * platform/qt/Skipped: * platform/win/Skipped: * svg/clip-path/clip-in-mask-objectBoundingBox-expected.txt: * svg/clip-path/clip-in-mask-userSpaceOnUse-expected.txt: * svg/clip-path/clip-path-childs-clipped-expected.txt: * svg/clip-path/clip-path-clipped-evenodd-twice-expected.txt: * svg/clip-path/clip-path-clipped-expected.txt: * svg/clip-path/clip-path-clipped-nonzero-expected.txt: * svg/clip-path/clip-path-css-transform-1-expected.txt: * svg/clip-path/clip-path-css-transform-2-expected.txt: * svg/clip-path/clip-path-objectBoundingBox-expected.txt: * svg/clip-path/clip-path-on-clipped-use-expected.txt: * svg/clip-path/clip-path-on-g-and-child-expected.txt: * svg/clip-path/clip-path-on-g-expected.txt: * svg/clip-path/clip-path-on-svg-and-child-expected.txt: * svg/clip-path/clip-path-on-svg-expected.txt: * svg/clip-path/clip-path-transform-2-expected.txt: * svg/clip-path/clip-path-use-as-child-expected.txt: * svg/css/circle-in-mask-with-shadow-expected.txt: * svg/css/mask-with-shadow-expected.txt: * svg/custom/absolute-root-position-masking-expected.txt: * svg/custom/fill-opacity-update-expected.txt: * svg/custom/gradient-stroke-width-expected.txt: * svg/custom/js-late-marker-and-object-creation-expected.txt: * svg/custom/js-late-marker-creation-expected.txt: * svg/custom/js-update-bounce-expected.txt: * svg/custom/marker-changes-expected.txt: * svg/custom/marker-child-changes-css-expected.txt: * svg/custom/marker-child-changes-expected.txt: * svg/custom/marker-strokeWidth-changes-expected.txt: * svg/custom/marker-viewBox-changes-expected.txt: * svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt: * svg/custom/pattern-scaled-pattern-space-expected.txt: * svg/custom/resource-invalidate-on-target-update-expected.txt: * svg/custom/stroke-opacity-update-expected.txt: * svg/custom/use-setAttribute-crash-expected.txt: * svg/custom/viewBox-hit-expected.txt: * svg/filters/feImage-reference-svg-primitive-expected.txt: * svg/filters/filter-clip-expected.txt: * svg/filters/invalidate-on-child-layout-expected.txt: * svg/hittest/svg-ellipse-expected.txt: Added. * svg/hittest/svg-ellipse-non-scale-stroke-expected.txt: Added. * svg/hittest/svg-ellipse-non-scale-stroke.xhtml: Added. * svg/hittest/svg-ellipse.xhtml: Added. * svg/hixie/links/001-expected.txt: Canonical link: https://commits.webkit.org/100054@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-30 15:37:16 +00:00
RenderSVGEllipse {circle} at (200,200) size 400x400 [fill={[type=SOLID] [color=#008000]}] [cx=400.00] [cy=400.00] [r=200.00]
<feImage> doesn't work with local references when using primitiveUnits="objectBoundingBox" https://bugs.webkit.org/show_bug.cgi?id=77205 Reviewed by Antti Koivisto. Source/WebCore: Consider following testcase: <svg width="1000" height="500"> <defs> <circle id="c" cx="50%" cy="50%" r="10%"/> <filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" primitiveUnits="objectBoundingBox"> <feImage xlink:href="#c"/> </filter> </defs> <rect width="100" height="100" filter="url(#f)"/> </svg> The <svg> has a viewport of 1000x50. The <circle> in the <defs> element is resolved as <circle cx="500" cy="250" r="79"/>, as the context for this element (looking at it isolated!) is the viewport of the <svg>. We then setup a 0x0 - 100x100 rect in user space, which gets filtered, by a filter, also defined in user space (for simplicity), but with primitiveUnits="objectBoundingBox". That means that the default subregion of the filter effect <feImage/> which has no inputs, is defined in the SVG 1.1 spec to be equal to the filter region, which is 0x0-100x100 in user space. This <feImage/> is supposed to produce a 100x100 image, containing a circle in the middle (aka. <circle cx="50" cy="50".../>), but it doesn't, as the <circle> it's trying to paint, is laid out at 500x250, and thus outside the 100x100 sized image buffer. So how to resolve this? The RenderSVGShape thats owned by the <circle> generates its Path value by calling cx().value(lengthContext) and the SVGLengthContext here resolves to the <svg>. That happens on _layout_. If we would want to change the SVGLengthContext in this case (what I originally planned!) to carry a custom 100x100 viewport, we'd need to relayout. Unfortunately this is not an option, as this would mean that SVGImageBufferTools::renderSubtreeToImageBuffer, would need to relayout its children first, but we produce the filter images when painting. This is very dangerous and has just recently been fixed so that SVGImageBufferTools can ASSERT(!item->needsLayout()) when painting the subtree to an image buffer. The only sane solution I see, that does not require relayouts, is to make a map between the <circle> bounding box in user space (500x250 center point) to the filter primitive subregion space (here: 100x100 center point), and concat that transformation before painting the subtree to the image buffer. Of course this approach only works if all values of the <circle> are relative. If someone uses <circle id="c" cx="50%" cy="666"> the transformation that I'm looking for is undefined. We'd really need to create a new Path here, to resolve only cx against the new viewport, and not cy. Though in practice it turns out this is not a problem. All use cases of feImage + primitiveUnits="objectBoundingBox" link to elements that are completely defined in percentual values, as this is really the only thing which makes sense - otherwise you can always switch back to primtiveUnits="userSpaceOnUse". Anyhow, I'm going to fix all known wild-life test cases by my approach, and say we don't support using mixed length units when referencing those elements from feImages with primitiveUnits="objectBoundingBox". Adding lots of new testcases, trying all the different feImage modes. Tests: svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-position.svg svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg svg/filters/feImage-subregions-preseveAspectRatio-none.svg svg/filters/feImage-subregions.svg * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Reverse logic, simplifying the code a bit. Remove FEImage special cases (absoluteSubregion). * svg/SVGLengthContext.h: Make determineViewport() public, for use in FEImage. * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Don't apply preserveAspectRatio transformation for local elements, it's not defined and breaks content. (WebCore::FEImage::platformApplySoftware): Figure out the absolute subregion by utilizing filterPrimitiveSubregion() as FETurbulence does. Map between filter primitive subregion and target object space for primitiveUnits="objectBoundingBox" support on SVG element references. * svg/graphics/filters/SVGFEImage.h: Remove absoluteSubregion member & setter, it's no longer needed. LayoutTests: Add new test cases covering all combinations of filterUnits/primitiveUnits and <feImage>. * platform/chromium/test_expectations.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-position-expected.png: Added. * platform/mac/svg/filters/feImage-position-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-position.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none.svg: Added. * svg/filters/feImage-subregions.svg: Added. * svg/filters/resources/green.png: Added. Canonical link: https://commits.webkit.org/94091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-27 13:54:21 +00:00
RenderSVGResourceFilter {filter} [id="filter1a-rel"] [filterUnits=objectBoundingBox] [primitiveUnits=objectBoundingBox]
Subpixel rendering: Transition class Image (and its dependencies) from int to float to enable subpixel positioned/sized images. https://bugs.webkit.org/show_bug.cgi?id=130643 Reviewed by Simon Fraser. This is in preparation to support subpixel positioned/sized background images. While 1x bitmap images can't take subpixel sizing on hidpi resolutions, both generated and hidpi images can. This patch does not change Image behavior in general as both position and size are still snapped to integral values. No change in behavior. Source/WebCore: * WebCore.exp.in: * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::fixedSize): * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::fixedSize): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::drawImageIntoBuffer): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::imageSizeForRenderer): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): * platform/Cursor.cpp: (WebCore::determineHotSpot): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::size): (WebCore::BitmapImage::currentFrameSize): * platform/graphics/BitmapImage.h: * platform/graphics/CrossfadeGeneratedImage.cpp: (WebCore::CrossfadeGeneratedImage::CrossfadeGeneratedImage): (WebCore::drawCrossfadeSubimage): (WebCore::CrossfadeGeneratedImage::drawCrossfade): * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/GeneratedImage.h: * platform/graphics/Gradient.cpp: (WebCore::Gradient::adjustParametersForTiledDrawing): * platform/graphics/Gradient.h: * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::drawPattern): * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::createCompatibleBuffer): * platform/graphics/GraphicsContext.h: * platform/graphics/Image.cpp: (WebCore::Image::adjustSourceRectForDownSampling): * platform/graphics/Image.h: (WebCore::Image::setContainerSize): (WebCore::Image::rect): (WebCore::Image::width): (WebCore::Image::height): * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::createCompatibleBuffer): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): * platform/graphics/IntPoint.cpp: (WebCore::IntPoint::IntPoint): * platform/graphics/IntPoint.h: * platform/graphics/IntSize.cpp: (WebCore::IntSize::IntSize): * platform/graphics/IntSize.h: * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cairo/ImageCairo.cpp: (WebCore::Image::drawPattern): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::size): (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): (WebCore::applyRotationForPainting): * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cg/PatternCG.cpp: (WebCore::Pattern::createPlatformPattern): * platform/graphics/mac/GraphicsContextMac.mm: * platform/graphics/mac/IconMac.mm: * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded): * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: (WebCore::CoordinatedImageBacking::update): * platform/graphics/win/ImageCGWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/ImageCairoWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/mac/DragImageMac.mm: (WebCore::createDragImageFromImage): * platform/win/DragImageCGWin.cpp: (WebCore::createDragImageFromImage): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImage): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageSizeForError): (WebCore::RenderImage::paintReplaced): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::drawPlatformResizerImage): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::setContainerSize): * svg/graphics/SVGImage.h: * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::imageSizeForRenderer): * svg/graphics/SVGImageCache.h: * svg/graphics/SVGImageForContainer.cpp: (WebCore::SVGImageForContainer::size): * svg/graphics/SVGImageForContainer.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::externalRepresentation): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Source/WebKit: * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Source/WebKit2: * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): LayoutTests: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-05-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-image-01-b-expected.txt: * svg/custom/feDisplacementMap-01-expected.txt: * svg/filters/feImage-change-target-id-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-late-indirect-update-expected.txt: * svg/filters/feImage-multiple-targets-id-change-expected.txt: * svg/filters/feImage-position-expected.txt: * svg/filters/feImage-preserveAspectRatio-all-expected.txt: * svg/filters/feImage-preserveAspectratio-expected.txt: * svg/filters/feImage-reference-invalidation-expected.txt: * svg/filters/feImage-reference-svg-primitive-expected.txt: * svg/filters/feImage-remove-target-expected.txt: * svg/filters/feImage-subregions-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: * svg/filters/feImage-target-add-to-document-expected.txt: * svg/filters/feImage-target-attribute-change-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-2-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-expected.txt: * svg/filters/feImage-target-changes-id-expected.txt: * svg/filters/feImage-target-id-change-expected.txt: * svg/filters/feImage-target-inline-style-change-expected.txt: * svg/filters/feImage-target-property-change-expected.txt: * svg/filters/feImage-target-reappend-to-document-expected.txt: * svg/filters/feImage-target-remove-from-document-expected.txt: * svg/filters/feImage-target-style-change-expected.txt: Canonical link: https://commits.webkit.org/149086@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-04-01 14:17:58 +00:00
[feImage image-size="400.00x400.00"]
<feImage> doesn't work with local references when using primitiveUnits="objectBoundingBox" https://bugs.webkit.org/show_bug.cgi?id=77205 Reviewed by Antti Koivisto. Source/WebCore: Consider following testcase: <svg width="1000" height="500"> <defs> <circle id="c" cx="50%" cy="50%" r="10%"/> <filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" primitiveUnits="objectBoundingBox"> <feImage xlink:href="#c"/> </filter> </defs> <rect width="100" height="100" filter="url(#f)"/> </svg> The <svg> has a viewport of 1000x50. The <circle> in the <defs> element is resolved as <circle cx="500" cy="250" r="79"/>, as the context for this element (looking at it isolated!) is the viewport of the <svg>. We then setup a 0x0 - 100x100 rect in user space, which gets filtered, by a filter, also defined in user space (for simplicity), but with primitiveUnits="objectBoundingBox". That means that the default subregion of the filter effect <feImage/> which has no inputs, is defined in the SVG 1.1 spec to be equal to the filter region, which is 0x0-100x100 in user space. This <feImage/> is supposed to produce a 100x100 image, containing a circle in the middle (aka. <circle cx="50" cy="50".../>), but it doesn't, as the <circle> it's trying to paint, is laid out at 500x250, and thus outside the 100x100 sized image buffer. So how to resolve this? The RenderSVGShape thats owned by the <circle> generates its Path value by calling cx().value(lengthContext) and the SVGLengthContext here resolves to the <svg>. That happens on _layout_. If we would want to change the SVGLengthContext in this case (what I originally planned!) to carry a custom 100x100 viewport, we'd need to relayout. Unfortunately this is not an option, as this would mean that SVGImageBufferTools::renderSubtreeToImageBuffer, would need to relayout its children first, but we produce the filter images when painting. This is very dangerous and has just recently been fixed so that SVGImageBufferTools can ASSERT(!item->needsLayout()) when painting the subtree to an image buffer. The only sane solution I see, that does not require relayouts, is to make a map between the <circle> bounding box in user space (500x250 center point) to the filter primitive subregion space (here: 100x100 center point), and concat that transformation before painting the subtree to the image buffer. Of course this approach only works if all values of the <circle> are relative. If someone uses <circle id="c" cx="50%" cy="666"> the transformation that I'm looking for is undefined. We'd really need to create a new Path here, to resolve only cx against the new viewport, and not cy. Though in practice it turns out this is not a problem. All use cases of feImage + primitiveUnits="objectBoundingBox" link to elements that are completely defined in percentual values, as this is really the only thing which makes sense - otherwise you can always switch back to primtiveUnits="userSpaceOnUse". Anyhow, I'm going to fix all known wild-life test cases by my approach, and say we don't support using mixed length units when referencing those elements from feImages with primitiveUnits="objectBoundingBox". Adding lots of new testcases, trying all the different feImage modes. Tests: svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-position.svg svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg svg/filters/feImage-subregions-preseveAspectRatio-none.svg svg/filters/feImage-subregions.svg * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Reverse logic, simplifying the code a bit. Remove FEImage special cases (absoluteSubregion). * svg/SVGLengthContext.h: Make determineViewport() public, for use in FEImage. * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Don't apply preserveAspectRatio transformation for local elements, it's not defined and breaks content. (WebCore::FEImage::platformApplySoftware): Figure out the absolute subregion by utilizing filterPrimitiveSubregion() as FETurbulence does. Map between filter primitive subregion and target object space for primitiveUnits="objectBoundingBox" support on SVG element references. * svg/graphics/filters/SVGFEImage.h: Remove absoluteSubregion member & setter, it's no longer needed. LayoutTests: Add new test cases covering all combinations of filterUnits/primitiveUnits and <feImage>. * platform/chromium/test_expectations.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-position-expected.png: Added. * platform/mac/svg/filters/feImage-position-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-position.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none.svg: Added. * svg/filters/feImage-subregions.svg: Added. * svg/filters/resources/green.png: Added. Canonical link: https://commits.webkit.org/94091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-27 13:54:21 +00:00
RenderSVGResourceFilter {filter} [id="filter1b-rel"] [filterUnits=objectBoundingBox] [primitiveUnits=objectBoundingBox]
Subpixel rendering: Transition class Image (and its dependencies) from int to float to enable subpixel positioned/sized images. https://bugs.webkit.org/show_bug.cgi?id=130643 Reviewed by Simon Fraser. This is in preparation to support subpixel positioned/sized background images. While 1x bitmap images can't take subpixel sizing on hidpi resolutions, both generated and hidpi images can. This patch does not change Image behavior in general as both position and size are still snapped to integral values. No change in behavior. Source/WebCore: * WebCore.exp.in: * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::fixedSize): * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::fixedSize): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::drawImageIntoBuffer): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::imageSizeForRenderer): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): * platform/Cursor.cpp: (WebCore::determineHotSpot): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::size): (WebCore::BitmapImage::currentFrameSize): * platform/graphics/BitmapImage.h: * platform/graphics/CrossfadeGeneratedImage.cpp: (WebCore::CrossfadeGeneratedImage::CrossfadeGeneratedImage): (WebCore::drawCrossfadeSubimage): (WebCore::CrossfadeGeneratedImage::drawCrossfade): * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/GeneratedImage.h: * platform/graphics/Gradient.cpp: (WebCore::Gradient::adjustParametersForTiledDrawing): * platform/graphics/Gradient.h: * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::drawPattern): * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::createCompatibleBuffer): * platform/graphics/GraphicsContext.h: * platform/graphics/Image.cpp: (WebCore::Image::adjustSourceRectForDownSampling): * platform/graphics/Image.h: (WebCore::Image::setContainerSize): (WebCore::Image::rect): (WebCore::Image::width): (WebCore::Image::height): * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::createCompatibleBuffer): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): * platform/graphics/IntPoint.cpp: (WebCore::IntPoint::IntPoint): * platform/graphics/IntPoint.h: * platform/graphics/IntSize.cpp: (WebCore::IntSize::IntSize): * platform/graphics/IntSize.h: * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cairo/ImageCairo.cpp: (WebCore::Image::drawPattern): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::size): (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): (WebCore::applyRotationForPainting): * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cg/PatternCG.cpp: (WebCore::Pattern::createPlatformPattern): * platform/graphics/mac/GraphicsContextMac.mm: * platform/graphics/mac/IconMac.mm: * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded): * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: (WebCore::CoordinatedImageBacking::update): * platform/graphics/win/ImageCGWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/ImageCairoWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/mac/DragImageMac.mm: (WebCore::createDragImageFromImage): * platform/win/DragImageCGWin.cpp: (WebCore::createDragImageFromImage): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImage): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageSizeForError): (WebCore::RenderImage::paintReplaced): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::drawPlatformResizerImage): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::setContainerSize): * svg/graphics/SVGImage.h: * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::imageSizeForRenderer): * svg/graphics/SVGImageCache.h: * svg/graphics/SVGImageForContainer.cpp: (WebCore::SVGImageForContainer::size): * svg/graphics/SVGImageForContainer.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::externalRepresentation): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Source/WebKit: * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Source/WebKit2: * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): LayoutTests: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-05-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-image-01-b-expected.txt: * svg/custom/feDisplacementMap-01-expected.txt: * svg/filters/feImage-change-target-id-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-late-indirect-update-expected.txt: * svg/filters/feImage-multiple-targets-id-change-expected.txt: * svg/filters/feImage-position-expected.txt: * svg/filters/feImage-preserveAspectRatio-all-expected.txt: * svg/filters/feImage-preserveAspectratio-expected.txt: * svg/filters/feImage-reference-invalidation-expected.txt: * svg/filters/feImage-reference-svg-primitive-expected.txt: * svg/filters/feImage-remove-target-expected.txt: * svg/filters/feImage-subregions-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: * svg/filters/feImage-target-add-to-document-expected.txt: * svg/filters/feImage-target-attribute-change-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-2-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-expected.txt: * svg/filters/feImage-target-changes-id-expected.txt: * svg/filters/feImage-target-id-change-expected.txt: * svg/filters/feImage-target-inline-style-change-expected.txt: * svg/filters/feImage-target-property-change-expected.txt: * svg/filters/feImage-target-reappend-to-document-expected.txt: * svg/filters/feImage-target-remove-from-document-expected.txt: * svg/filters/feImage-target-style-change-expected.txt: Canonical link: https://commits.webkit.org/149086@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-04-01 14:17:58 +00:00
[feImage image-size="400.00x400.00"]
<feImage> doesn't work with local references when using primitiveUnits="objectBoundingBox" https://bugs.webkit.org/show_bug.cgi?id=77205 Reviewed by Antti Koivisto. Source/WebCore: Consider following testcase: <svg width="1000" height="500"> <defs> <circle id="c" cx="50%" cy="50%" r="10%"/> <filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" primitiveUnits="objectBoundingBox"> <feImage xlink:href="#c"/> </filter> </defs> <rect width="100" height="100" filter="url(#f)"/> </svg> The <svg> has a viewport of 1000x50. The <circle> in the <defs> element is resolved as <circle cx="500" cy="250" r="79"/>, as the context for this element (looking at it isolated!) is the viewport of the <svg>. We then setup a 0x0 - 100x100 rect in user space, which gets filtered, by a filter, also defined in user space (for simplicity), but with primitiveUnits="objectBoundingBox". That means that the default subregion of the filter effect <feImage/> which has no inputs, is defined in the SVG 1.1 spec to be equal to the filter region, which is 0x0-100x100 in user space. This <feImage/> is supposed to produce a 100x100 image, containing a circle in the middle (aka. <circle cx="50" cy="50".../>), but it doesn't, as the <circle> it's trying to paint, is laid out at 500x250, and thus outside the 100x100 sized image buffer. So how to resolve this? The RenderSVGShape thats owned by the <circle> generates its Path value by calling cx().value(lengthContext) and the SVGLengthContext here resolves to the <svg>. That happens on _layout_. If we would want to change the SVGLengthContext in this case (what I originally planned!) to carry a custom 100x100 viewport, we'd need to relayout. Unfortunately this is not an option, as this would mean that SVGImageBufferTools::renderSubtreeToImageBuffer, would need to relayout its children first, but we produce the filter images when painting. This is very dangerous and has just recently been fixed so that SVGImageBufferTools can ASSERT(!item->needsLayout()) when painting the subtree to an image buffer. The only sane solution I see, that does not require relayouts, is to make a map between the <circle> bounding box in user space (500x250 center point) to the filter primitive subregion space (here: 100x100 center point), and concat that transformation before painting the subtree to the image buffer. Of course this approach only works if all values of the <circle> are relative. If someone uses <circle id="c" cx="50%" cy="666"> the transformation that I'm looking for is undefined. We'd really need to create a new Path here, to resolve only cx against the new viewport, and not cy. Though in practice it turns out this is not a problem. All use cases of feImage + primitiveUnits="objectBoundingBox" link to elements that are completely defined in percentual values, as this is really the only thing which makes sense - otherwise you can always switch back to primtiveUnits="userSpaceOnUse". Anyhow, I'm going to fix all known wild-life test cases by my approach, and say we don't support using mixed length units when referencing those elements from feImages with primitiveUnits="objectBoundingBox". Adding lots of new testcases, trying all the different feImage modes. Tests: svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-position.svg svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg svg/filters/feImage-subregions-preseveAspectRatio-none.svg svg/filters/feImage-subregions.svg * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Reverse logic, simplifying the code a bit. Remove FEImage special cases (absoluteSubregion). * svg/SVGLengthContext.h: Make determineViewport() public, for use in FEImage. * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Don't apply preserveAspectRatio transformation for local elements, it's not defined and breaks content. (WebCore::FEImage::platformApplySoftware): Figure out the absolute subregion by utilizing filterPrimitiveSubregion() as FETurbulence does. Map between filter primitive subregion and target object space for primitiveUnits="objectBoundingBox" support on SVG element references. * svg/graphics/filters/SVGFEImage.h: Remove absoluteSubregion member & setter, it's no longer needed. LayoutTests: Add new test cases covering all combinations of filterUnits/primitiveUnits and <feImage>. * platform/chromium/test_expectations.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-position-expected.png: Added. * platform/mac/svg/filters/feImage-position-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-position.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none.svg: Added. * svg/filters/feImage-subregions.svg: Added. * svg/filters/resources/green.png: Added. Canonical link: https://commits.webkit.org/94091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-27 13:54:21 +00:00
RenderSVGResourceFilter {filter} [id="filter2a-rel"] [filterUnits=objectBoundingBox] [primitiveUnits=objectBoundingBox]
Subpixel rendering: Transition class Image (and its dependencies) from int to float to enable subpixel positioned/sized images. https://bugs.webkit.org/show_bug.cgi?id=130643 Reviewed by Simon Fraser. This is in preparation to support subpixel positioned/sized background images. While 1x bitmap images can't take subpixel sizing on hidpi resolutions, both generated and hidpi images can. This patch does not change Image behavior in general as both position and size are still snapped to integral values. No change in behavior. Source/WebCore: * WebCore.exp.in: * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::fixedSize): * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::fixedSize): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::drawImageIntoBuffer): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::imageSizeForRenderer): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): * platform/Cursor.cpp: (WebCore::determineHotSpot): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::size): (WebCore::BitmapImage::currentFrameSize): * platform/graphics/BitmapImage.h: * platform/graphics/CrossfadeGeneratedImage.cpp: (WebCore::CrossfadeGeneratedImage::CrossfadeGeneratedImage): (WebCore::drawCrossfadeSubimage): (WebCore::CrossfadeGeneratedImage::drawCrossfade): * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/GeneratedImage.h: * platform/graphics/Gradient.cpp: (WebCore::Gradient::adjustParametersForTiledDrawing): * platform/graphics/Gradient.h: * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::drawPattern): * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::createCompatibleBuffer): * platform/graphics/GraphicsContext.h: * platform/graphics/Image.cpp: (WebCore::Image::adjustSourceRectForDownSampling): * platform/graphics/Image.h: (WebCore::Image::setContainerSize): (WebCore::Image::rect): (WebCore::Image::width): (WebCore::Image::height): * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::createCompatibleBuffer): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): * platform/graphics/IntPoint.cpp: (WebCore::IntPoint::IntPoint): * platform/graphics/IntPoint.h: * platform/graphics/IntSize.cpp: (WebCore::IntSize::IntSize): * platform/graphics/IntSize.h: * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cairo/ImageCairo.cpp: (WebCore::Image::drawPattern): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::size): (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): (WebCore::applyRotationForPainting): * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cg/PatternCG.cpp: (WebCore::Pattern::createPlatformPattern): * platform/graphics/mac/GraphicsContextMac.mm: * platform/graphics/mac/IconMac.mm: * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded): * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: (WebCore::CoordinatedImageBacking::update): * platform/graphics/win/ImageCGWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/ImageCairoWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/mac/DragImageMac.mm: (WebCore::createDragImageFromImage): * platform/win/DragImageCGWin.cpp: (WebCore::createDragImageFromImage): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImage): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageSizeForError): (WebCore::RenderImage::paintReplaced): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::drawPlatformResizerImage): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::setContainerSize): * svg/graphics/SVGImage.h: * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::imageSizeForRenderer): * svg/graphics/SVGImageCache.h: * svg/graphics/SVGImageForContainer.cpp: (WebCore::SVGImageForContainer::size): * svg/graphics/SVGImageForContainer.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::externalRepresentation): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Source/WebKit: * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Source/WebKit2: * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): LayoutTests: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-05-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-image-01-b-expected.txt: * svg/custom/feDisplacementMap-01-expected.txt: * svg/filters/feImage-change-target-id-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-late-indirect-update-expected.txt: * svg/filters/feImage-multiple-targets-id-change-expected.txt: * svg/filters/feImage-position-expected.txt: * svg/filters/feImage-preserveAspectRatio-all-expected.txt: * svg/filters/feImage-preserveAspectratio-expected.txt: * svg/filters/feImage-reference-invalidation-expected.txt: * svg/filters/feImage-reference-svg-primitive-expected.txt: * svg/filters/feImage-remove-target-expected.txt: * svg/filters/feImage-subregions-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: * svg/filters/feImage-target-add-to-document-expected.txt: * svg/filters/feImage-target-attribute-change-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-2-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-expected.txt: * svg/filters/feImage-target-changes-id-expected.txt: * svg/filters/feImage-target-id-change-expected.txt: * svg/filters/feImage-target-inline-style-change-expected.txt: * svg/filters/feImage-target-property-change-expected.txt: * svg/filters/feImage-target-reappend-to-document-expected.txt: * svg/filters/feImage-target-remove-from-document-expected.txt: * svg/filters/feImage-target-style-change-expected.txt: Canonical link: https://commits.webkit.org/149086@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-04-01 14:17:58 +00:00
[feImage image-size="400.00x400.00"]
<feImage> doesn't work with local references when using primitiveUnits="objectBoundingBox" https://bugs.webkit.org/show_bug.cgi?id=77205 Reviewed by Antti Koivisto. Source/WebCore: Consider following testcase: <svg width="1000" height="500"> <defs> <circle id="c" cx="50%" cy="50%" r="10%"/> <filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" primitiveUnits="objectBoundingBox"> <feImage xlink:href="#c"/> </filter> </defs> <rect width="100" height="100" filter="url(#f)"/> </svg> The <svg> has a viewport of 1000x50. The <circle> in the <defs> element is resolved as <circle cx="500" cy="250" r="79"/>, as the context for this element (looking at it isolated!) is the viewport of the <svg>. We then setup a 0x0 - 100x100 rect in user space, which gets filtered, by a filter, also defined in user space (for simplicity), but with primitiveUnits="objectBoundingBox". That means that the default subregion of the filter effect <feImage/> which has no inputs, is defined in the SVG 1.1 spec to be equal to the filter region, which is 0x0-100x100 in user space. This <feImage/> is supposed to produce a 100x100 image, containing a circle in the middle (aka. <circle cx="50" cy="50".../>), but it doesn't, as the <circle> it's trying to paint, is laid out at 500x250, and thus outside the 100x100 sized image buffer. So how to resolve this? The RenderSVGShape thats owned by the <circle> generates its Path value by calling cx().value(lengthContext) and the SVGLengthContext here resolves to the <svg>. That happens on _layout_. If we would want to change the SVGLengthContext in this case (what I originally planned!) to carry a custom 100x100 viewport, we'd need to relayout. Unfortunately this is not an option, as this would mean that SVGImageBufferTools::renderSubtreeToImageBuffer, would need to relayout its children first, but we produce the filter images when painting. This is very dangerous and has just recently been fixed so that SVGImageBufferTools can ASSERT(!item->needsLayout()) when painting the subtree to an image buffer. The only sane solution I see, that does not require relayouts, is to make a map between the <circle> bounding box in user space (500x250 center point) to the filter primitive subregion space (here: 100x100 center point), and concat that transformation before painting the subtree to the image buffer. Of course this approach only works if all values of the <circle> are relative. If someone uses <circle id="c" cx="50%" cy="666"> the transformation that I'm looking for is undefined. We'd really need to create a new Path here, to resolve only cx against the new viewport, and not cy. Though in practice it turns out this is not a problem. All use cases of feImage + primitiveUnits="objectBoundingBox" link to elements that are completely defined in percentual values, as this is really the only thing which makes sense - otherwise you can always switch back to primtiveUnits="userSpaceOnUse". Anyhow, I'm going to fix all known wild-life test cases by my approach, and say we don't support using mixed length units when referencing those elements from feImages with primitiveUnits="objectBoundingBox". Adding lots of new testcases, trying all the different feImage modes. Tests: svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-position.svg svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg svg/filters/feImage-subregions-preseveAspectRatio-none.svg svg/filters/feImage-subregions.svg * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Reverse logic, simplifying the code a bit. Remove FEImage special cases (absoluteSubregion). * svg/SVGLengthContext.h: Make determineViewport() public, for use in FEImage. * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Don't apply preserveAspectRatio transformation for local elements, it's not defined and breaks content. (WebCore::FEImage::platformApplySoftware): Figure out the absolute subregion by utilizing filterPrimitiveSubregion() as FETurbulence does. Map between filter primitive subregion and target object space for primitiveUnits="objectBoundingBox" support on SVG element references. * svg/graphics/filters/SVGFEImage.h: Remove absoluteSubregion member & setter, it's no longer needed. LayoutTests: Add new test cases covering all combinations of filterUnits/primitiveUnits and <feImage>. * platform/chromium/test_expectations.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-position-expected.png: Added. * platform/mac/svg/filters/feImage-position-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-position.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none.svg: Added. * svg/filters/feImage-subregions.svg: Added. * svg/filters/resources/green.png: Added. Canonical link: https://commits.webkit.org/94091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-27 13:54:21 +00:00
RenderSVGResourceFilter {filter} [id="filter2b-rel"] [filterUnits=objectBoundingBox] [primitiveUnits=objectBoundingBox]
Subpixel rendering: Transition class Image (and its dependencies) from int to float to enable subpixel positioned/sized images. https://bugs.webkit.org/show_bug.cgi?id=130643 Reviewed by Simon Fraser. This is in preparation to support subpixel positioned/sized background images. While 1x bitmap images can't take subpixel sizing on hidpi resolutions, both generated and hidpi images can. This patch does not change Image behavior in general as both position and size are still snapped to integral values. No change in behavior. Source/WebCore: * WebCore.exp.in: * css/CSSCrossfadeValue.cpp: (WebCore::CSSCrossfadeValue::fixedSize): * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::fixedSize): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::drawImageIntoBuffer): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::imageSizeForRenderer): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): * platform/Cursor.cpp: (WebCore::determineHotSpot): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::size): (WebCore::BitmapImage::currentFrameSize): * platform/graphics/BitmapImage.h: * platform/graphics/CrossfadeGeneratedImage.cpp: (WebCore::CrossfadeGeneratedImage::CrossfadeGeneratedImage): (WebCore::drawCrossfadeSubimage): (WebCore::CrossfadeGeneratedImage::drawCrossfade): * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/GeneratedImage.h: * platform/graphics/Gradient.cpp: (WebCore::Gradient::adjustParametersForTiledDrawing): * platform/graphics/Gradient.h: * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::drawPattern): * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::createCompatibleBuffer): * platform/graphics/GraphicsContext.h: * platform/graphics/Image.cpp: (WebCore::Image::adjustSourceRectForDownSampling): * platform/graphics/Image.h: (WebCore::Image::setContainerSize): (WebCore::Image::rect): (WebCore::Image::width): (WebCore::Image::height): * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::createCompatibleBuffer): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): * platform/graphics/IntPoint.cpp: (WebCore::IntPoint::IntPoint): * platform/graphics/IntPoint.h: * platform/graphics/IntSize.cpp: (WebCore::IntSize::IntSize): * platform/graphics/IntSize.h: * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cairo/ImageCairo.cpp: (WebCore::Image::drawPattern): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::size): (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): (WebCore::applyRotationForPainting): * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cg/PatternCG.cpp: (WebCore::Pattern::createPlatformPattern): * platform/graphics/mac/GraphicsContextMac.mm: * platform/graphics/mac/IconMac.mm: * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded): * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: (WebCore::CoordinatedImageBacking::update): * platform/graphics/win/ImageCGWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/ImageCairoWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/mac/DragImageMac.mm: (WebCore::createDragImageFromImage): * platform/win/DragImageCGWin.cpp: (WebCore::createDragImageFromImage): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImage): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageSizeForError): (WebCore::RenderImage::paintReplaced): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::drawPlatformResizerImage): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::setContainerSize): * svg/graphics/SVGImage.h: * svg/graphics/SVGImageCache.cpp: (WebCore::SVGImageCache::imageSizeForRenderer): * svg/graphics/SVGImageCache.h: * svg/graphics/SVGImageForContainer.cpp: (WebCore::SVGImageForContainer::size): * svg/graphics/SVGImageForContainer.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::externalRepresentation): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Source/WebKit: * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Source/WebKit2: * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): LayoutTests: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1-SE/filters-image-05-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.txt: * platform/mac/svg/W3C-SVG-1.1/filters-image-01-b-expected.txt: * svg/custom/feDisplacementMap-01-expected.txt: * svg/filters/feImage-change-target-id-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: * svg/filters/feImage-late-indirect-update-expected.txt: * svg/filters/feImage-multiple-targets-id-change-expected.txt: * svg/filters/feImage-position-expected.txt: * svg/filters/feImage-preserveAspectRatio-all-expected.txt: * svg/filters/feImage-preserveAspectratio-expected.txt: * svg/filters/feImage-reference-invalidation-expected.txt: * svg/filters/feImage-reference-svg-primitive-expected.txt: * svg/filters/feImage-remove-target-expected.txt: * svg/filters/feImage-subregions-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: * svg/filters/feImage-target-add-to-document-expected.txt: * svg/filters/feImage-target-attribute-change-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-2-expected.txt: * svg/filters/feImage-target-attribute-change-with-use-indirection-expected.txt: * svg/filters/feImage-target-changes-id-expected.txt: * svg/filters/feImage-target-id-change-expected.txt: * svg/filters/feImage-target-inline-style-change-expected.txt: * svg/filters/feImage-target-property-change-expected.txt: * svg/filters/feImage-target-reappend-to-document-expected.txt: * svg/filters/feImage-target-remove-from-document-expected.txt: * svg/filters/feImage-target-style-change-expected.txt: Canonical link: https://commits.webkit.org/149086@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-04-01 14:17:58 +00:00
[feImage image-size="400.00x400.00"]
<feImage> doesn't work with local references when using primitiveUnits="objectBoundingBox" https://bugs.webkit.org/show_bug.cgi?id=77205 Reviewed by Antti Koivisto. Source/WebCore: Consider following testcase: <svg width="1000" height="500"> <defs> <circle id="c" cx="50%" cy="50%" r="10%"/> <filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" primitiveUnits="objectBoundingBox"> <feImage xlink:href="#c"/> </filter> </defs> <rect width="100" height="100" filter="url(#f)"/> </svg> The <svg> has a viewport of 1000x50. The <circle> in the <defs> element is resolved as <circle cx="500" cy="250" r="79"/>, as the context for this element (looking at it isolated!) is the viewport of the <svg>. We then setup a 0x0 - 100x100 rect in user space, which gets filtered, by a filter, also defined in user space (for simplicity), but with primitiveUnits="objectBoundingBox". That means that the default subregion of the filter effect <feImage/> which has no inputs, is defined in the SVG 1.1 spec to be equal to the filter region, which is 0x0-100x100 in user space. This <feImage/> is supposed to produce a 100x100 image, containing a circle in the middle (aka. <circle cx="50" cy="50".../>), but it doesn't, as the <circle> it's trying to paint, is laid out at 500x250, and thus outside the 100x100 sized image buffer. So how to resolve this? The RenderSVGShape thats owned by the <circle> generates its Path value by calling cx().value(lengthContext) and the SVGLengthContext here resolves to the <svg>. That happens on _layout_. If we would want to change the SVGLengthContext in this case (what I originally planned!) to carry a custom 100x100 viewport, we'd need to relayout. Unfortunately this is not an option, as this would mean that SVGImageBufferTools::renderSubtreeToImageBuffer, would need to relayout its children first, but we produce the filter images when painting. This is very dangerous and has just recently been fixed so that SVGImageBufferTools can ASSERT(!item->needsLayout()) when painting the subtree to an image buffer. The only sane solution I see, that does not require relayouts, is to make a map between the <circle> bounding box in user space (500x250 center point) to the filter primitive subregion space (here: 100x100 center point), and concat that transformation before painting the subtree to the image buffer. Of course this approach only works if all values of the <circle> are relative. If someone uses <circle id="c" cx="50%" cy="666"> the transformation that I'm looking for is undefined. We'd really need to create a new Path here, to resolve only cx against the new viewport, and not cy. Though in practice it turns out this is not a problem. All use cases of feImage + primitiveUnits="objectBoundingBox" link to elements that are completely defined in percentual values, as this is really the only thing which makes sense - otherwise you can always switch back to primtiveUnits="userSpaceOnUse". Anyhow, I'm going to fix all known wild-life test cases by my approach, and say we don't support using mixed length units when referencing those elements from feImages with primitiveUnits="objectBoundingBox". Adding lots of new testcases, trying all the different feImage modes. Tests: svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg svg/filters/feImage-position.svg svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg svg/filters/feImage-subregions-preseveAspectRatio-none.svg svg/filters/feImage-subregions.svg * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Reverse logic, simplifying the code a bit. Remove FEImage special cases (absoluteSubregion). * svg/SVGLengthContext.h: Make determineViewport() public, for use in FEImage. * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Don't apply preserveAspectRatio transformation for local elements, it's not defined and breaks content. (WebCore::FEImage::platformApplySoftware): Figure out the absolute subregion by utilizing filterPrimitiveSubregion() as FETurbulence does. Map between filter primitive subregion and target object space for primitiveUnits="objectBoundingBox" support on SVG element references. * svg/graphics/filters/SVGFEImage.h: Remove absoluteSubregion member & setter, it's no longer needed. LayoutTests: Add new test cases covering all combinations of filterUnits/primitiveUnits and <feImage>. * platform/chromium/test_expectations.txt: * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.txt: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png: Added. * platform/mac/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.txt: Added. * platform/mac/svg/filters/feImage-position-expected.png: Added. * platform/mac/svg/filters/feImage-position-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.png: Added. * platform/mac/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox.svg: Added. * svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse.svg: Added. * svg/filters/feImage-position.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox.svg: Added. * svg/filters/feImage-subregions-preseveAspectRatio-none.svg: Added. * svg/filters/feImage-subregions.svg: Added. * svg/filters/resources/green.png: Added. Canonical link: https://commits.webkit.org/94091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-27 13:54:21 +00:00
RenderSVGContainer {g} at (0,0) size 350x200
RenderSVGRect {rect} at (49,49) size 102x102 [stroke={[type=SOLID] [color=#FF0000]}] [x=50.00] [y=50.00] [width=100.00] [height=100.00]
RenderSVGRect {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=200.00] [height=200.00]
[filter="filter1a-rel"] RenderSVGResourceFilter {filter} at (0,0) size 200x200
RenderSVGContainer {g} at (150,0) size 200x200 [transform={m=((1.00,0.00)(0.00,1.00)) t=(150.00,0.00)}]
RenderSVGRect {rect} at (199,49) size 102x102 [stroke={[type=SOLID] [color=#FF0000]}] [x=50.00] [y=50.00] [width=100.00] [height=100.00]
RenderSVGRect {rect} at (150,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=200.00] [height=200.00]
[filter="filter1b-rel"] RenderSVGResourceFilter {filter} at (0,0) size 200x200
RenderSVGContainer {g} at (0,130) size 370x240 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,150.00)}]
RenderSVGRect {rect} at (39,189) size 122x122 [stroke={[type=SOLID] [color=#FF0000]}] [x=40.00] [y=40.00] [width=120.00] [height=120.00]
RenderSVGRect {rect} at (0,130) size 221x240 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=200.00] [height=200.00]
[filter="filter2a-rel"] RenderSVGResourceFilter {filter} at (-20,-20) size 240x240
RenderSVGContainer {g} at (130,130) size 240x240 [transform={m=((1.00,0.00)(0.00,1.00)) t=(150.00,0.00)}]
RenderSVGRect {rect} at (189,189) size 122x122 [stroke={[type=SOLID] [color=#FF0000]}] [x=40.00] [y=40.00] [width=120.00] [height=120.00]
RenderSVGRect {rect} at (130,130) size 240x240 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=200.00] [height=200.00]
[filter="filter2b-rel"] RenderSVGResourceFilter {filter} at (-20,-20) size 240x240