Changeset 57511 in webkit
- Timestamp:
- Apr 13, 2010 5:45:20 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 130 added
- 1 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r57510 r57511 1 2010-04-13 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 <clipPath> doesn't correctly handle <text> elements 6 https://bugs.webkit.org/show_bug.cgi?id=12571 7 8 33 new Tests for SVG's clip-path. Test behavior of different clip objects 9 like text as well as different clip rules. 10 Other older tests are rendered correctly now. 11 12 * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.checksum: 13 * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.png: 14 * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.txt: 15 * platform/mac/svg/W3C-SVG-1.1/masking-path-01-b-expected.checksum: 16 * platform/mac/svg/W3C-SVG-1.1/masking-path-01-b-expected.png: 17 * platform/mac/svg/W3C-SVG-1.1/masking-path-04-b-expected.checksum: 18 * platform/mac/svg/W3C-SVG-1.1/masking-path-04-b-expected.png: 19 * platform/mac/svg/W3C-SVG-1.1/masking-path-04-b-expected.txt: 20 * platform/mac/svg/batik/text/textEffect2-expected.checksum: 21 * platform/mac/svg/batik/text/textEffect2-expected.png: 22 * platform/mac/svg/batik/text/textEffect2-expected.txt: 23 * platform/mac/svg/batik/text/textProperties-expected.checksum: 24 * platform/mac/svg/batik/text/textProperties-expected.png: 25 * platform/mac/svg/batik/text/textProperties-expected.txt: 26 * platform/mac/svg/clip-path: Added. 27 * platform/mac/svg/clip-path/clip-path-child-clipped-expected.checksum: Added. 28 * platform/mac/svg/clip-path/clip-path-child-clipped-expected.png: Added. 29 * platform/mac/svg/clip-path/clip-path-child-clipped-expected.txt: Added. 30 * platform/mac/svg/clip-path/clip-path-childs-clipped-expected.checksum: Added. 31 * platform/mac/svg/clip-path/clip-path-childs-clipped-expected.png: Added. 32 * platform/mac/svg/clip-path/clip-path-childs-clipped-expected.txt: Added. 33 * platform/mac/svg/clip-path/clip-path-clipped-evenodd-twice-expected.checksum: Added. 34 * platform/mac/svg/clip-path/clip-path-clipped-evenodd-twice-expected.png: Added. 35 * platform/mac/svg/clip-path/clip-path-clipped-evenodd-twice-expected.txt: Added. 36 * platform/mac/svg/clip-path/clip-path-clipped-expected.checksum: Added. 37 * platform/mac/svg/clip-path/clip-path-clipped-expected.png: Added. 38 * platform/mac/svg/clip-path/clip-path-clipped-expected.txt: Added. 39 * platform/mac/svg/clip-path/clip-path-clipped-no-content-expected.checksum: Added. 40 * platform/mac/svg/clip-path/clip-path-clipped-no-content-expected.png: Added. 41 * platform/mac/svg/clip-path/clip-path-clipped-no-content-expected.txt: Added. 42 * platform/mac/svg/clip-path/clip-path-clipped-nonzero-expected.checksum: Added. 43 * platform/mac/svg/clip-path/clip-path-clipped-nonzero-expected.png: Added. 44 * platform/mac/svg/clip-path/clip-path-clipped-nonzero-expected.txt: Added. 45 * platform/mac/svg/clip-path/clip-path-evenodd-expected.checksum: Added. 46 * platform/mac/svg/clip-path/clip-path-evenodd-expected.png: Added. 47 * platform/mac/svg/clip-path/clip-path-evenodd-expected.txt: Added. 48 * platform/mac/svg/clip-path/clip-path-evenodd-nonzero-expected.checksum: Added. 49 * platform/mac/svg/clip-path/clip-path-evenodd-nonzero-expected.png: Added. 50 * platform/mac/svg/clip-path/clip-path-evenodd-nonzero-expected.txt: Added. 51 * platform/mac/svg/clip-path/clip-path-nonzero-evenodd-expected.checksum: Added. 52 * platform/mac/svg/clip-path/clip-path-nonzero-evenodd-expected.png: Added. 53 * platform/mac/svg/clip-path/clip-path-nonzero-evenodd-expected.txt: Added. 54 * platform/mac/svg/clip-path/clip-path-nonzero-expected.checksum: Added. 55 * platform/mac/svg/clip-path/clip-path-nonzero-expected.png: Added. 56 * platform/mac/svg/clip-path/clip-path-nonzero-expected.txt: Added. 57 * platform/mac/svg/clip-path/clip-path-objectBoundingBox-expected.checksum: Added. 58 * platform/mac/svg/clip-path/clip-path-objectBoundingBox-expected.png: Added. 59 * platform/mac/svg/clip-path/clip-path-objectBoundingBox-expected.txt: Added. 60 * platform/mac/svg/clip-path/clip-path-on-clipped-use-expected.checksum: Added. 61 * platform/mac/svg/clip-path/clip-path-on-clipped-use-expected.png: Added. 62 * platform/mac/svg/clip-path/clip-path-on-clipped-use-expected.txt: Added. 63 * platform/mac/svg/clip-path/clip-path-on-g-and-child-expected.checksum: Added. 64 * platform/mac/svg/clip-path/clip-path-on-g-and-child-expected.png: Added. 65 * platform/mac/svg/clip-path/clip-path-on-g-and-child-expected.txt: Added. 66 * platform/mac/svg/clip-path/clip-path-on-g-expected.checksum: Added. 67 * platform/mac/svg/clip-path/clip-path-on-g-expected.png: Added. 68 * platform/mac/svg/clip-path/clip-path-on-g-expected.txt: Added. 69 * platform/mac/svg/clip-path/clip-path-on-svg-and-child-expected.checksum: Added. 70 * platform/mac/svg/clip-path/clip-path-on-svg-and-child-expected.png: Added. 71 * platform/mac/svg/clip-path/clip-path-on-svg-and-child-expected.txt: Added. 72 * platform/mac/svg/clip-path/clip-path-on-svg-expected.checksum: Added. 73 * platform/mac/svg/clip-path/clip-path-on-svg-expected.png: Added. 74 * platform/mac/svg/clip-path/clip-path-on-svg-expected.txt: Added. 75 * platform/mac/svg/clip-path/clip-path-recursive-call-by-child-expected.checksum: Added. 76 * platform/mac/svg/clip-path/clip-path-recursive-call-by-child-expected.png: Added. 77 * platform/mac/svg/clip-path/clip-path-recursive-call-by-child-expected.txt: Added. 78 * platform/mac/svg/clip-path/clip-path-recursive-call-expected.checksum: Added. 79 * platform/mac/svg/clip-path/clip-path-recursive-call-expected.png: Added. 80 * platform/mac/svg/clip-path/clip-path-recursive-call-expected.txt: Added. 81 * platform/mac/svg/clip-path/clip-path-text-and-shape-expected.checksum: Added. 82 * platform/mac/svg/clip-path/clip-path-text-and-shape-expected.png: Added. 83 * platform/mac/svg/clip-path/clip-path-text-and-shape-expected.txt: Added. 84 * platform/mac/svg/clip-path/clip-path-text-and-stroke-expected.checksum: Added. 85 * platform/mac/svg/clip-path/clip-path-text-and-stroke-expected.png: Added. 86 * platform/mac/svg/clip-path/clip-path-text-and-stroke-expected.txt: Added. 87 * platform/mac/svg/clip-path/clip-path-text-expected.checksum: Added. 88 * platform/mac/svg/clip-path/clip-path-text-expected.png: Added. 89 * platform/mac/svg/clip-path/clip-path-text-expected.txt: Added. 90 * platform/mac/svg/clip-path/clip-path-use-as-child-expected.checksum: Added. 91 * platform/mac/svg/clip-path/clip-path-use-as-child-expected.png: Added. 92 * platform/mac/svg/clip-path/clip-path-use-as-child-expected.txt: Added. 93 * platform/mac/svg/clip-path/clip-path-use-as-child2-expected.checksum: Added. 94 * platform/mac/svg/clip-path/clip-path-use-as-child2-expected.png: Added. 95 * platform/mac/svg/clip-path/clip-path-use-as-child2-expected.txt: Added. 96 * platform/mac/svg/clip-path/clip-path-use-as-child3-expected.checksum: Added. 97 * platform/mac/svg/clip-path/clip-path-use-as-child3-expected.png: Added. 98 * platform/mac/svg/clip-path/clip-path-use-as-child3-expected.txt: Added. 99 * platform/mac/svg/clip-path/clip-path-use-as-child4-expected.checksum: Added. 100 * platform/mac/svg/clip-path/clip-path-use-as-child4-expected.png: Added. 101 * platform/mac/svg/clip-path/clip-path-use-as-child4-expected.txt: Added. 102 * platform/mac/svg/clip-path/clip-path-use-as-child5-expected.checksum: Added. 103 * platform/mac/svg/clip-path/clip-path-use-as-child5-expected.png: Added. 104 * platform/mac/svg/clip-path/clip-path-use-as-child5-expected.txt: Added. 105 * platform/mac/svg/clip-path/clip-path-userSpaceOnUse-expected.checksum: Added. 106 * platform/mac/svg/clip-path/clip-path-userSpaceOnUse-expected.png: Added. 107 * platform/mac/svg/clip-path/clip-path-userSpaceOnUse-expected.txt: Added. 108 * platform/mac/svg/clip-path/clip-path-with-container-expected.checksum: Added. 109 * platform/mac/svg/clip-path/clip-path-with-container-expected.png: Added. 110 * platform/mac/svg/clip-path/clip-path-with-container-expected.txt: Added. 111 * platform/mac/svg/clip-path/clip-path-with-different-unittypes-expected.checksum: Added. 112 * platform/mac/svg/clip-path/clip-path-with-different-unittypes-expected.png: Added. 113 * platform/mac/svg/clip-path/clip-path-with-different-unittypes-expected.txt: Added. 114 * platform/mac/svg/clip-path/clip-path-with-different-unittypes2-expected.checksum: Added. 115 * platform/mac/svg/clip-path/clip-path-with-different-unittypes2-expected.png: Added. 116 * platform/mac/svg/clip-path/clip-path-with-different-unittypes2-expected.txt: Added. 117 * platform/mac/svg/clip-path/clip-path-with-invisibile-child-expected.checksum: Added. 118 * platform/mac/svg/clip-path/clip-path-with-invisibile-child-expected.png: Added. 119 * platform/mac/svg/clip-path/clip-path-with-invisibile-child-expected.txt: Added. 120 * platform/mac/svg/clip-path/clip-path-with-text-clipped-expected.checksum: Added. 121 * platform/mac/svg/clip-path/clip-path-with-text-clipped-expected.png: Added. 122 * platform/mac/svg/clip-path/clip-path-with-text-clipped-expected.txt: Added. 123 * platform/mac/svg/custom/clip-path-child-changes-expected.txt: 124 * platform/mac/svg/custom/clip-path-href-changes-expected.txt: 125 * platform/mac/svg/custom/clip-path-units-changes-expected.txt: 126 * platform/mac/svg/custom/clip-path-with-transform-expected.txt: 127 * platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.txt: 128 * platform/mac/svg/filters/filterRes-expected.checksum: 129 * svg/clip-path: Added. 130 * svg/clip-path/clip-path-child-clipped.svg: Added. 131 * svg/clip-path/clip-path-childs-clipped.svg: Added. 132 * svg/clip-path/clip-path-clipped-evenodd-twice.svg: Added. 133 * svg/clip-path/clip-path-clipped-no-content.svg: Added. 134 * svg/clip-path/clip-path-clipped-nonzero.svg: Added. 135 * svg/clip-path/clip-path-clipped.svg: Added. 136 * svg/clip-path/clip-path-evenodd-nonzero.svg: Added. 137 * svg/clip-path/clip-path-evenodd.svg: Added. 138 * svg/clip-path/clip-path-nonzero-evenodd.svg: Added. 139 * svg/clip-path/clip-path-nonzero.svg: Added. 140 * svg/clip-path/clip-path-objectBoundingBox.svg: Added. 141 * svg/clip-path/clip-path-on-clipped-use.svg: Added. 142 * svg/clip-path/clip-path-on-g-and-child.svg: Added. 143 * svg/clip-path/clip-path-on-g.svg: Added. 144 * svg/clip-path/clip-path-on-svg-and-child.svg: Added. 145 * svg/clip-path/clip-path-on-svg.svg: Added. 146 * svg/clip-path/clip-path-recursive-call-by-child.svg: Added. 147 * svg/clip-path/clip-path-recursive-call.svg: Added. 148 * svg/clip-path/clip-path-text-and-shape.svg: Added. 149 * svg/clip-path/clip-path-text-and-stroke.svg: Added. 150 * svg/clip-path/clip-path-text.svg: Added. 151 * svg/clip-path/clip-path-use-as-child.svg: Added. 152 * svg/clip-path/clip-path-use-as-child2.svg: Added. 153 * svg/clip-path/clip-path-use-as-child3.svg: Added. 154 * svg/clip-path/clip-path-use-as-child4.svg: Added. 155 * svg/clip-path/clip-path-use-as-child5.svg: Added. 156 * svg/clip-path/clip-path-userSpaceOnUse.svg: Added. 157 * svg/clip-path/clip-path-with-container.svg: Added. 158 * svg/clip-path/clip-path-with-different-unittypes.svg: Added. 159 * svg/clip-path/clip-path-with-different-unittypes2.svg: Added. 160 * svg/clip-path/clip-path-with-invisibile-child.svg: Added. 161 * svg/clip-path/clip-path-with-text-clipped.svg: Added. 162 * svg/custom/clip-path-display-none-child.svg: Removed. 163 1 164 2010-04-13 Nikolas Zimmermann <nzimmermann@rim.com> 2 165 -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.checksum
r52449 r57511 1 b0f6900bcc82d46b4ca04966064a9cfc 1 12ac53d50854581aa61d0a7b692d688e -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.txt
r55289 r57511 10 10 RenderPath {circle} at (0,0) size 1x1 [stroke={[type=SOLID] [color=#FF0000] [stroke width=0.15]}] [data="M0.50,0.50 L0.50,0.51 L0.50,0.53 L0.50,0.54 L0.49,0.55 L0.49,0.56 L0.49,0.57 L0.48,0.59 L0.48,0.60 L0.47,0.61 L0.46,0.62 L0.45,0.63 L0.45,0.64 L0.44,0.65 L0.43,0.65 L0.42,0.66 L0.41,0.67 L0.40,0.68 L0.39,0.68 L0.37,0.69 L0.36,0.69 L0.35,0.69 L0.34,0.70 L0.33,0.70 L0.31,0.70 L0.30,0.70 L0.29,0.70 L0.27,0.70 L0.26,0.70 L0.25,0.69 L0.24,0.69 L0.23,0.69 L0.21,0.68 L0.20,0.68 L0.19,0.67 L0.18,0.66 L0.17,0.65 L0.16,0.65 L0.15,0.64 L0.15,0.63 L0.14,0.62 L0.13,0.61 L0.12,0.60 L0.12,0.59 L0.11,0.57 L0.11,0.56 L0.11,0.55 L0.10,0.54 L0.10,0.53 L0.10,0.51 L0.10,0.50 L0.10,0.49 L0.10,0.47 L0.10,0.46 L0.11,0.45 L0.11,0.44 L0.11,0.43 L0.12,0.41 L0.12,0.40 L0.13,0.39 L0.14,0.38 L0.15,0.37 L0.15,0.36 L0.16,0.35 L0.17,0.35 L0.18,0.34 L0.19,0.33 L0.20,0.32 L0.21,0.32 L0.23,0.31 L0.24,0.31 L0.25,0.31 L0.26,0.30 L0.27,0.30 L0.29,0.30 L0.30,0.30 L0.31,0.30 L0.33,0.30 L0.34,0.30 L0.35,0.31 L0.36,0.31 L0.37,0.31 L0.39,0.32 L0.40,0.32 L0.41,0.33 L0.42,0.34 L0.43,0.35 L0.44,0.35 L0.45,0.36 L0.45,0.37 L0.46,0.38 L0.47,0.39 L0.48,0.40 L0.48,0.41 L0.49,0.43 L0.49,0.44 L0.49,0.45 L0.50,0.46 L0.50,0.47 L0.50,0.49 Z"] 11 11 RenderPath {circle} at (0,0) size 1x1 [data="M0.90,0.50 L0.90,0.51 L0.90,0.53 L0.90,0.54 L0.89,0.55 L0.89,0.56 L0.89,0.57 L0.88,0.59 L0.88,0.60 L0.87,0.61 L0.86,0.62 L0.85,0.63 L0.85,0.64 L0.84,0.65 L0.83,0.65 L0.82,0.66 L0.81,0.67 L0.80,0.68 L0.79,0.68 L0.77,0.69 L0.76,0.69 L0.75,0.69 L0.74,0.70 L0.73,0.70 L0.71,0.70 L0.70,0.70 L0.69,0.70 L0.67,0.70 L0.66,0.70 L0.65,0.69 L0.64,0.69 L0.63,0.69 L0.61,0.68 L0.60,0.68 L0.59,0.67 L0.58,0.66 L0.57,0.65 L0.56,0.65 L0.55,0.64 L0.55,0.63 L0.54,0.62 L0.53,0.61 L0.52,0.60 L0.52,0.59 L0.51,0.57 L0.51,0.56 L0.51,0.55 L0.50,0.54 L0.50,0.53 L0.50,0.51 L0.50,0.50 L0.50,0.49 L0.50,0.47 L0.50,0.46 L0.51,0.45 L0.51,0.44 L0.51,0.43 L0.52,0.41 L0.52,0.40 L0.53,0.39 L0.54,0.38 L0.55,0.37 L0.55,0.36 L0.56,0.35 L0.57,0.35 L0.58,0.34 L0.59,0.33 L0.60,0.32 L0.61,0.32 L0.63,0.31 L0.64,0.31 L0.65,0.31 L0.66,0.30 L0.67,0.30 L0.69,0.30 L0.70,0.30 L0.71,0.30 L0.73,0.30 L0.74,0.30 L0.75,0.31 L0.76,0.31 L0.77,0.31 L0.79,0.32 L0.80,0.32 L0.81,0.33 L0.82,0.34 L0.83,0.35 L0.84,0.35 L0.85,0.36 L0.85,0.37 L0.86,0.38 L0.87,0.39 L0.88,0.40 L0.88,0.41 L0.89,0.43 L0.89,0.44 L0.89,0.45 L0.90,0.46 L0.90,0.47 L0.90,0.49 Z"] 12 RenderPath {rect} at (1 70,60) size 160x80 [fill={[type=SOLID] [color=#00008B]}] [data="M150.00,0.00 L350.00,0.00 L350.00,200.00 L150.00,200.00 Z"]13 [clipPath="one"] RenderSVGResourceClipper {clipPath} at (1 70,60) size 160x8012 RenderPath {rect} at (155,45) size 175x110 [fill={[type=SOLID] [color=#00008B]}] [data="M150.00,0.00 L350.00,0.00 L350.00,200.00 L150.00,200.00 Z"] 13 [clipPath="one"] RenderSVGResourceClipper {clipPath} at (155.01,45.01) size 174.99x109.99 14 14 RenderSVGText {text} at (50,110) size 111x18 contains 1 chunk(s) 15 15 RenderSVGInlineText {#text} at (0,-14) size 111x18 -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-path-01-b-expected.checksum
r44224 r57511 1 37c73da9090f6294aa40f0d5cfadda8e 1 d583e883ebbf7991b856cf0493ca678f -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-path-04-b-expected.checksum
r44224 r57511 1 ad37975cea7e831b178e4116e7834d3e 1 7c4f67d3942d7ecbe79417f95d5bc268 -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-path-04-b-expected.txt
r55289 r57511 3 3 layer at (0,0) size 480x360 4 4 RenderSVGRoot {svg} at (0,0) size 480x360 5 RenderSVGContainer {g} at ( 20,20) size 420x3105 RenderSVGContainer {g} at (30,20) size 410x271 6 6 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 7 7 RenderSVGResourceClipper {clipPath} [id="sample"] [clipPathUnits=userSpaceOnUse] … … 14 14 RenderSVGInlineText {#text} at (0,-101) size 353x122 15 15 chunk 1 text run 1 at (55.00,130.00) startOffset 0 endOffset 9 width 353.00: "Clip Test" 16 RenderSVGContainer {g} at ( 20,170) size 410x16017 RenderSVGImage {image} at ( 20,170) size 410x16018 [clipPath="sample"] RenderSVGResourceClipper {clipPath} at ( 0,0) size 0x016 RenderSVGContainer {g} at (45,170) size 353x121 17 RenderSVGImage {image} at (45,170) size 353x121 18 [clipPath="sample"] RenderSVGResourceClipper {clipPath} at (45,169) size 353x122 19 19 RenderSVGText {text} at (10,340) size 264x46 contains 1 chunk(s) 20 20 RenderSVGInlineText {#text} at (0,-36) size 264x46 -
trunk/LayoutTests/platform/mac/svg/batik/text/textEffect2-expected.checksum
r44224 r57511 1 2f1894dcccaed9ce694520a3d2ce98a5 1 3d83519b1c2a4090bf4ce2519503c45a -
trunk/LayoutTests/platform/mac/svg/batik/text/textEffect2-expected.txt
r55289 r57511 24 24 RenderSVGInlineText {#text} at (0,-48) size 152x59 25 25 chunk 1 text run 1 at (100.00,300.00) startOffset 0 endOffset 5 width 152.00: "BATIK" 26 RenderPath {rect} at (100,160) size 200x45 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFD700), (0.50,#FFA500), (1.00,#DC143C)]] [start=(0,0)] [end=(1,0)]}] [data="M100.00,160.00 L300.00,160.00 L300.00,205.00 L100.00,205.00 Z"]27 [clipPath="clip"] RenderSVGResourceClipper {clipPath} at ( 0,0) size 0x026 RenderPath {rect} at (100,160) size 152x45 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFD700), (0.50,#FFA500), (1.00,#DC143C)]] [start=(0,0)] [end=(1,0)]}] [data="M100.00,160.00 L300.00,160.00 L300.00,205.00 L100.00,205.00 Z"] 27 [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (100,152) size 152x59 28 28 RenderSVGText {text} at (300,200) size 65x14 contains 1 chunk(s) 29 29 RenderSVGInlineText {#text} at (0,-11) size 65x14 30 30 chunk 1 text run 1 at (300.00,200.00) startOffset 0 endOffset 13 width 65.00: "(System font)" 31 RenderPath {rect} at (100,260) size 200x45 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFD700), (0.50,#FFA500), (1.00,#DC143C)]] [start=(0,0)] [end=(1,0)]}] [data="M100.00,260.00 L300.00,260.00 L300.00,305.00 L100.00,305.00 Z"]32 [clipPath="svgClip"] RenderSVGResourceClipper {clipPath} at ( 0,0) size 0x031 RenderPath {rect} at (100,260) size 152x45 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFD700), (0.50,#FFA500), (1.00,#DC143C)]] [start=(0,0)] [end=(1,0)]}] [data="M100.00,260.00 L300.00,260.00 L300.00,305.00 L100.00,305.00 Z"] 32 [clipPath="svgClip"] RenderSVGResourceClipper {clipPath} at (100,252) size 152x59 33 33 RenderSVGText {text} at (300,300) size 55x14 contains 1 chunk(s) 34 34 RenderSVGInlineText {#text} at (0,-11) size 55x14 -
trunk/LayoutTests/platform/mac/svg/batik/text/textProperties-expected.checksum
r53070 r57511 1 898d6b106dc1f3fefc0b8026f591b84d 1 66e5cba8112b6b2ff9d72b2999987c4f -
trunk/LayoutTests/platform/mac/svg/batik/text/textProperties-expected.txt
r55289 r57511 139 139 RenderSVGGradientStop {stop} at (0,0) size 0x0 140 140 RenderSVGGradientStop {stop} at (0,0) size 0x0 141 RenderSVGContainer {g} at (300,345) size 100x 50[transform={m=((1.00,0.00)(0.00,1.00)) t=(350.00,370.00)}]142 RenderPath {rect} at (30 0,345) size 100x50[fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#008000)]] [bounding box mode=0] [start=(-50,-25)] [end=(50,25)]}] [data="M-50.00,-25.00 L50.00,-25.00 L50.00,25.00 L-50.00,25.00 Z"]143 [clipPath="textClip"] RenderSVGResourceClipper {clipPath} at ( 0,0) size 0x0141 RenderSVGContainer {g} at (300,345) size 100x44 [transform={m=((1.00,0.00)(0.00,1.00)) t=(350.00,370.00)}] 142 RenderPath {rect} at (308,345) size 84x33 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#0000FF), (1.00,#008000)]] [bounding box mode=0] [start=(-50,-25)] [end=(50,25)]}] [data="M-50.00,-25.00 L50.00,-25.00 L50.00,25.00 L-50.00,25.00 Z"] 143 [clipPath="textClip"] RenderSVGResourceClipper {clipPath} at (-42,-28) size 84x36 144 144 RenderSVGText {text} at (-50,15) size 100x18 contains 1 chunk(s) 145 145 RenderSVGInlineText {#text} at (0,-14) size 100x18 -
trunk/LayoutTests/platform/mac/svg/custom/clip-path-child-changes-expected.txt
r55289 r57511 6 6 RenderSVGResourceClipper {clipPath} [id="myclip"] [clipPathUnits=userSpaceOnUse] 7 7 RenderPath {path} at (0,0) size 100x100 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 8 RenderSVGContainer {g} at (0,0) size 200x2009 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 200x2008 RenderSVGContainer {g} at (0,0) size 100x100 9 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100 10 10 RenderPath {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 11 11 RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"] -
trunk/LayoutTests/platform/mac/svg/custom/clip-path-href-changes-expected.txt
r55289 r57511 6 6 RenderSVGResourceClipper {clipPath} [id="myclip"] [clipPathUnits=userSpaceOnUse] 7 7 RenderPath {path} at (0,0) size 100x100 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 8 RenderSVGContainer {g} at (0,0) size 200x2009 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 200x2008 RenderSVGContainer {g} at (0,0) size 100x100 9 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100 10 10 RenderPath {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 11 11 RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"] -
trunk/LayoutTests/platform/mac/svg/custom/clip-path-units-changes-expected.txt
r55289 r57511 6 6 RenderSVGResourceClipper {clipPath} [id="myclip"] [clipPathUnits=userSpaceOnUse] 7 7 RenderPath {path} at (0,0) size 100x100 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 8 RenderSVGContainer {g} at (0,0) size 200x2009 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 200x2008 RenderSVGContainer {g} at (0,0) size 100x100 9 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100 10 10 RenderPath {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 11 11 RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"] -
trunk/LayoutTests/platform/mac/svg/custom/clip-path-with-transform-expected.txt
r55289 r57511 6 6 RenderSVGResourceClipper {clipPath} [id="myclip"] [clipPathUnits=userSpaceOnUse] 7 7 RenderPath {path} at (0,0) size 100x100 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 8 RenderSVGContainer {g} at (0,0) size 200x2009 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 200x2008 RenderSVGContainer {g} at (0,0) size 100x100 9 [clipPath="myclip"] RenderSVGResourceClipper {clipPath} at (0,0) size 100x100 10 10 RenderPath {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00 Z"] 11 11 RenderPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z"] -
trunk/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.txt
r55293 r57511 9 9 RenderSVGContainer {g} at (0,0) size 2x3 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.40,0.40)}] 10 10 RenderPath {rect} at (0,0) size 2x3 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L0.20,0.00 L0.20,0.20 L0.00,0.20 Z"] 11 RenderPath {rect} at (1 20,120) size 60x60[fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"]12 [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (1 20,120) size 60x6011 RenderPath {rect} at (107,107) size 86x86 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"] 12 [clipPath="clip"] RenderSVGResourceClipper {clipPath} at (107.57,107.57) size 84.85x84.85 -
trunk/WebCore/ChangeLog
r57509 r57511 1 2010-04-13 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 <clipPath> doesn't correctly handle <text> elements 6 https://bugs.webkit.org/show_bug.cgi?id=12571 7 8 Adds support for text elements as clipPath, heterogenous clip rules, as well 9 as clipping of clipPath. 10 A fast code path let platforms clip simple shapes directly. All other variants 11 are drawn to a seperate ImageBuffer, which is used as a mask. This happens the same 12 way we like we do it on SVG Masking. This needs temporary changes to the RenderStyle 13 of clipPath childs. Values like stroke, resources, opacity have to be ignored. 14 15 Tests: svg/clip-path/clip-path-child-clipped.svg 16 svg/clip-path/clip-path-childs-clipped.svg 17 svg/clip-path/clip-path-clipped-evenodd-twice.svg 18 svg/clip-path/clip-path-clipped-no-content.svg 19 svg/clip-path/clip-path-clipped-nonzero.svg 20 svg/clip-path/clip-path-clipped.svg 21 svg/clip-path/clip-path-evenodd-nonzero.svg 22 svg/clip-path/clip-path-evenodd.svg 23 svg/clip-path/clip-path-nonzero-evenodd.svg 24 svg/clip-path/clip-path-nonzero.svg 25 svg/clip-path/clip-path-objectBoundingBox.svg 26 svg/clip-path/clip-path-on-clipped-use.svg 27 svg/clip-path/clip-path-on-g-and-child.svg 28 svg/clip-path/clip-path-on-g.svg 29 svg/clip-path/clip-path-on-svg-and-child.svg 30 svg/clip-path/clip-path-on-svg.svg 31 svg/clip-path/clip-path-recursive-call-by-child.svg 32 svg/clip-path/clip-path-recursive-call.svg 33 svg/clip-path/clip-path-text-and-shape.svg 34 svg/clip-path/clip-path-text-and-stroke.svg 35 svg/clip-path/clip-path-text.svg 36 svg/clip-path/clip-path-use-as-child.svg 37 svg/clip-path/clip-path-use-as-child2.svg 38 svg/clip-path/clip-path-use-as-child3.svg 39 svg/clip-path/clip-path-use-as-child4.svg 40 svg/clip-path/clip-path-use-as-child5.svg 41 svg/clip-path/clip-path-userSpaceOnUse.svg 42 svg/clip-path/clip-path-with-container.svg 43 svg/clip-path/clip-path-with-different-unittypes.svg 44 svg/clip-path/clip-path-with-different-unittypes2.svg 45 svg/clip-path/clip-path-with-invisibile-child.svg 46 svg/clip-path/clip-path-with-text-clipped.svg 47 48 * rendering/RenderObject.h: 49 (WebCore::RenderObject::isSVGShadowTreeRootContainer): identify use-element renderer 50 * rendering/RenderSVGResourceClipper.cpp: 51 (WebCore::RenderSVGResourceClipper::invalidateClients): 52 (WebCore::RenderSVGResourceClipper::invalidateClient): 53 (WebCore::RenderSVGResourceClipper::applyResource): 54 (WebCore::RenderSVGResourceClipper::pathOnlyClipping): direct clipping for simple shapes 55 (WebCore::RenderSVGResourceClipper::applyClippingToContext): direct clipping or maskImage? 56 (WebCore::RenderSVGResourceClipper::createClipData): creates maskImage for clipping 57 (WebCore::RenderSVGResourceClipper::resourceBoundingBox): 58 * rendering/RenderSVGResourceClipper.h: 59 * rendering/RenderSVGShadowTreeRootContainer.h: identify use-Element by renderer 60 (WebCore::RenderSVGShadowTreeRootContainer::isSVGShadowTreeRootContainer): 61 * rendering/SVGRenderSupport.cpp: 62 (WebCore::renderSubtreeToImage): hack to get texts working on clipping (masks and pattern) 63 * svg/SVGUseElement.cpp: 64 (WebCore::SVGUseElement::rendererClipChild): get renderer of referenced object 65 * svg/SVGUseElement.h: 66 1 67 2010-04-13 Nikolas Zimmermann <nzimmermann@rim.com> 2 68 -
trunk/WebCore/rendering/RenderObject.h
r57509 r57511 338 338 virtual bool isSVGForeignObject() const { return false; } 339 339 virtual bool isSVGResource() const { return false; } 340 virtual bool isSVGShadowTreeRootContainer() const { return false; } 340 341 341 342 virtual const SVGRenderBase* toSVGRenderBase() const; -
trunk/WebCore/rendering/RenderSVGResourceClipper.cpp
r57509 r57511 27 27 #include "FloatRect.h" 28 28 #include "GraphicsContext.h" 29 #include "ImageBuffer.h" 30 #include "IntRect.h" 31 #include "RenderObject.h" 32 #include "RenderStyle.h" 29 33 #include "RenderSVGResource.h" 30 34 #include "SVGClipPathElement.h" … … 34 38 #include "SVGStyledTransformableElement.h" 35 39 #include "SVGUnitTypes.h" 40 #include "SVGUseElement.h" 36 41 37 42 namespace WebCore { … … 51 56 void RenderSVGResourceClipper::invalidateClients() 52 57 { 53 Hash Set<RenderObject*>::const_iterator end = m_clipper.end();54 for (Hash Set<RenderObject*>::const_iterator it = m_clipper.begin(); it != end; ++it) {55 RenderObject* renderer = *it;58 HashMap<RenderObject*, ClipperData*>::const_iterator end = m_clipper.end(); 59 for (HashMap<RenderObject*, ClipperData*>::const_iterator it = m_clipper.begin(); it != end; ++it) { 60 RenderObject* renderer = it->first; 56 61 renderer->setNeedsBoundariesUpdate(); 57 62 renderer->setNeedsLayout(true); 58 63 } 59 64 deleteAllValues(m_clipper); 60 65 m_clipper.clear(); 61 66 } … … 72 77 return; 73 78 74 m_clipper. remove(object);79 m_clipper.take(object); 75 80 } 76 81 77 82 bool RenderSVGResourceClipper::applyResource(RenderObject* object, GraphicsContext* context) 83 { 84 applyClippingToContext(object, object->objectBoundingBox(), object->repaintRectInLocalCoordinates(), context); 85 return true; 86 } 87 88 bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext* context, const FloatRect& objectBoundingBox) 89 { 90 // If the current clip-path gets clipped itself, we have to fallback to masking. 91 if (!style()->svgStyle()->clipPath().isEmpty()) 92 return false; 93 WindRule clipRule = RULE_NONZERO; 94 Path clipPath = Path(); 95 96 // If clip-path only contains one visible shape or path, we can use path-based clipping. Invisible 97 // shapes don't affect the clipping and can be ignored. If clip-path contains more than one 98 // visible shape, the additive clipping may not work, caused by the clipRule. EvenOdd 99 // as well as NonZero can cause self-clipping of the elements. 100 // See also http://www.w3.org/TR/SVG/painting.html#FillRuleProperty 101 for (Node* childNode = node()->firstChild(); childNode; childNode = childNode->nextSibling()) { 102 RenderObject* renderer = childNode->renderer(); 103 if (!renderer) 104 continue; 105 // Only shapes or paths are supported for direct clipping. We need to fallback to masking for texts. 106 if (renderer->isSVGText()) 107 return false; 108 if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyledTransformable()) 109 continue; 110 SVGStyledTransformableElement* styled = static_cast<SVGStyledTransformableElement*>(childNode); 111 RenderStyle* style = renderer->style(); 112 if (!style || style->display() == NONE || style->visibility() != VISIBLE) 113 continue; 114 const SVGRenderStyle* svgStyle = style->svgStyle(); 115 // Current shape in clip-path gets clipped too. Fallback to masking. 116 if (!svgStyle->clipPath().isEmpty()) 117 return false; 118 // Fallback to masking, if there is more than one clipping path. 119 if (clipPath.isEmpty()) { 120 clipPath = styled->toClipPath(); 121 clipRule = svgStyle->clipRule(); 122 } else 123 return false; 124 } 125 // Only one visible shape/path was found. Directly continue clipping and transform the content to userspace if necessary. 126 if (static_cast<SVGClipPathElement*>(node())->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) { 127 AffineTransform transform; 128 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 129 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height()); 130 clipPath.transform(transform); 131 } 132 // The SVG specification wants us to clip everything, if clip-path doesn't have a child. 133 if (clipPath.isEmpty()) 134 clipPath.addRect(FloatRect()); 135 context->beginPath(); 136 context->addPath(clipPath); 137 context->clipPath(clipRule); 138 return true; 139 } 140 141 bool RenderSVGResourceClipper::applyClippingToContext(RenderObject* object, const FloatRect& objectBoundingBox, 142 const FloatRect& repaintRect, GraphicsContext* context) 78 143 { 79 144 ASSERT(object); 80 145 ASSERT(context); 81 146 82 m_clipper.add(object); 83 84 context->beginPath(); 85 86 AffineTransform obbTransform; 87 FloatRect objectBoundingBox = object->objectBoundingBox(); 88 bool bbox = static_cast<SVGClipPathElement*>(node())->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; 89 if (bbox) { 90 obbTransform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 91 obbTransform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height()); 92 } 93 94 bool hasClipPath = false; 95 WindRule clipRule = RULE_EVENODD; 147 if (!m_clipper.contains(object)) 148 m_clipper.set(object, new ClipperData); 149 150 ClipperData* clipperData = m_clipper.get(object); 151 if (!clipperData->clipMaskImage) { 152 if (pathOnlyClipping(context, objectBoundingBox)) 153 return true; 154 createClipData(clipperData, objectBoundingBox, repaintRect); 155 } 156 157 if (!clipperData->clipMaskImage) 158 return false; 159 160 context->clipToImageBuffer(repaintRect, clipperData->clipMaskImage.get()); 161 return true; 162 } 163 164 bool RenderSVGResourceClipper::createClipData(ClipperData* clipperData, const FloatRect& objectBoundingBox, const FloatRect& repaintRect) 165 { 166 IntRect clipMaskRect = enclosingIntRect(repaintRect); 167 clipperData->clipMaskImage = ImageBuffer::create(clipMaskRect.size()); 168 if (!clipperData->clipMaskImage) 169 return false; 170 171 GraphicsContext* maskContext = clipperData->clipMaskImage->context(); 172 ASSERT(maskContext); 173 174 maskContext->save(); 175 maskContext->translate(-repaintRect.x(), -repaintRect.y()); 176 177 // clipPath can also be clipped by another clipPath. 178 bool clipperGetsClipped = false; 179 if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(this->document(), style()->svgStyle()->clipPath())) { 180 clipperGetsClipped = true; 181 if (!clipper->applyClippingToContext(this, objectBoundingBox, repaintRect, maskContext)) { 182 maskContext->restore(); 183 return false; 184 } 185 } 186 187 SVGClipPathElement* clipPath = static_cast<SVGClipPathElement*>(node()); 188 if (clipPath->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) { 189 maskContext->translate(objectBoundingBox.x(), objectBoundingBox.y()); 190 maskContext->scale(objectBoundingBox.size()); 191 } 192 193 // Draw all clipPath children into a global mask. 96 194 for (Node* childNode = node()->firstChild(); childNode; childNode = childNode->nextSibling()) { 97 if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyledTransformable()) 98 continue; 99 SVGStyledTransformableElement* styled = static_cast<SVGStyledTransformableElement*>(childNode); 100 RenderStyle* style = styled->renderer() ? styled->renderer()->style() : 0; 101 if (!style || style->display() == NONE) 102 continue; 103 Path pathData = styled->toClipPath(); 104 if (pathData.isEmpty()) 105 continue; 106 if (bbox) 107 pathData.transform(obbTransform); 108 hasClipPath = true; 109 context->addPath(pathData); 110 clipRule = style->svgStyle()->clipRule(); 111 } 112 113 if (!hasClipPath) { 114 Path clipPath; 115 clipPath.addRect(FloatRect()); 116 context->addPath(clipPath); 117 } 118 119 // FIXME! 120 // We don't currently allow for heterogenous clip rules. 121 // we would have to detect such, draw to a mask, and then clip 122 // to that mask 123 context->clipPath(clipRule); 195 RenderObject* renderer = childNode->renderer(); 196 if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyled() || !renderer) 197 continue; 198 RenderStyle* style = renderer->style(); 199 if (!style || style->display() == NONE || style->visibility() != VISIBLE) 200 continue; 201 202 WindRule newClipRule = style->svgStyle()->clipRule(); 203 bool isUseElement = renderer->isSVGShadowTreeRootContainer(); 204 if (isUseElement) { 205 SVGUseElement* useElement = static_cast<SVGUseElement*>(childNode); 206 renderer = useElement->rendererClipChild(); 207 if (!renderer) 208 continue; 209 if (!useElement->hasAttribute(SVGNames::clip_ruleAttr)) 210 newClipRule = renderer->style()->svgStyle()->clipRule(); 211 } 212 213 // Only shapes, paths and texts are allowed for clipping. 214 if (!renderer->isRenderPath() && !renderer->isSVGText()) 215 continue; 216 217 // Save the old RenderStyle of the current object for restoring after drawing 218 // it to the MaskImage. The new intermediate RenderStyle needs to inherit from 219 // the old one. 220 RefPtr<RenderStyle> oldRenderStyle = renderer->style(); 221 RefPtr<RenderStyle> newRenderStyle = RenderStyle::clone(oldRenderStyle.get()); 222 SVGRenderStyle* svgStyle = newRenderStyle.get()->accessSVGStyle(); 223 svgStyle->setFillPaint(SVGPaint::defaultFill()); 224 svgStyle->setStrokePaint(SVGPaint::defaultStroke()); 225 svgStyle->setFillRule(newClipRule); 226 newRenderStyle.get()->setOpacity(1.0f); 227 svgStyle->setFillOpacity(1.0f); 228 svgStyle->setStrokeOpacity(1.0f); 229 svgStyle->setFilter(String()); 230 svgStyle->setMaskElement(String()); 231 renderer->setStyle(newRenderStyle.release()); 232 233 // Get the renderer of the element, that is referenced by the <use>-element. 234 if (isUseElement) 235 renderer = childNode->renderer(); 236 237 renderSubtreeToImage(clipperData->clipMaskImage.get(), renderer); 238 239 renderer->setStyle(oldRenderStyle.release()); 240 } 241 242 maskContext->restore(); 124 243 125 244 return true; … … 128 247 FloatRect RenderSVGResourceClipper::resourceBoundingBox(const FloatRect& objectBoundingBox) const 129 248 { 249 // This is a rough heuristic to appraise the clip size and doesn't consider clip on clip. 130 250 FloatRect clipRect; 131 251 for (Node* childNode = node()->firstChild(); childNode; childNode = childNode->nextSibling()) { 132 if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyledTransformable()) 133 continue; 134 SVGStyledTransformableElement* styled = static_cast<SVGStyledTransformableElement*>(childNode); 135 RenderStyle* style = styled->renderer() ? styled->renderer()->style() : 0; 136 if (!style || style->display() == NONE) 137 continue; 138 clipRect.unite(styled->renderer()->objectBoundingBox()); 139 } 140 141 if (clipRect.isEmpty()) 142 return FloatRect(); 252 RenderObject* renderer = childNode->renderer(); 253 if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyled() || !renderer) 254 continue; 255 if (!renderer->isRenderPath() && !renderer->isSVGText() && !renderer->isSVGShadowTreeRootContainer()) 256 continue; 257 clipRect.unite(renderer->localToParentTransform().mapRect(renderer->repaintRectInLocalCoordinates())); 258 } 143 259 144 260 if (static_cast<SVGClipPathElement*>(node())->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) { 145 AffineTransform obbTransform;146 obbTransform.translate(objectBoundingBox.x(), objectBoundingBox.y());147 obbTransform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());148 return obbTransform.mapRect(clipRect);261 AffineTransform transform; 262 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 263 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height()); 264 return transform.mapRect(clipRect); 149 265 } 150 266 -
trunk/WebCore/rendering/RenderSVGResourceClipper.h
r55289 r57511 25 25 #include "FloatRect.h" 26 26 #include "GraphicsContext.h" 27 #include "ImageBuffer.h" 28 #include "IntSize.h" 29 #include "Path.h" 27 30 #include "RenderSVGResource.h" 28 31 #include "SVGClipPathElement.h" 29 32 #include "SVGUnitTypes.h" 30 33 31 #include <wtf/HashSet.h> 34 #include <wtf/HashMap.h> 35 #include <wtf/OwnPtr.h> 32 36 33 37 namespace WebCore { 38 39 struct ClipperData { 40 OwnPtr<ImageBuffer> clipMaskImage; 41 }; 34 42 35 43 class RenderSVGResourceClipper : public RenderSVGResource { … … 53 61 static RenderSVGResourceType s_resourceType; 54 62 private: 55 HashSet<RenderObject*> m_clipper; 63 // clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call 64 // applyResource directly and use the rects from the object, since they are empty for RenderSVGResources 65 bool applyClippingToContext(RenderObject*, const FloatRect&, const FloatRect&, GraphicsContext*); 66 bool pathOnlyClipping(GraphicsContext*, const FloatRect&); 67 bool createClipData(ClipperData*, const FloatRect&, const FloatRect&); 68 69 HashMap<RenderObject*, ClipperData*> m_clipper; 56 70 }; 57 71 -
trunk/WebCore/rendering/RenderSVGShadowTreeRootContainer.h
r53446 r57511 34 34 virtual ~RenderSVGShadowTreeRootContainer(); 35 35 36 virtual bool isSVGShadowTreeRootContainer() const { return true; } 37 36 38 void markShadowTreeForRecreation() { m_recreateTree = true; } 37 39 void updateStyle(Node::StyleChange); -
trunk/WebCore/rendering/SVGRenderSupport.cpp
r57482 r57511 189 189 ASSERT(image); 190 190 ASSERT(image->context()); 191 RenderObject::PaintInfo info(image->context(), IntRect(), PaintPhaseForeground, 0, 0, 0); 191 192 // FIXME: This sets the rect to the viewable area of the current frame. This 193 // is used to support text drawings to the ImageBuffer. See bug 30399. 194 IntRect rect; 195 FrameView* frameView = item->document()->view(); 196 if (frameView) 197 rect = IntRect(0, 0, frameView->visibleWidth(), frameView->visibleHeight()); 198 RenderObject::PaintInfo info(image->context(), rect, PaintPhaseForeground, 0, 0, 0); 192 199 193 200 // FIXME: isSVGContainer returns true for RenderSVGViewportContainer, so if this is ever -
trunk/WebCore/svg/SVGUseElement.cpp
r57509 r57511 612 612 } 613 613 614 RenderObject* SVGUseElement::rendererClipChild() const 615 { 616 Node* n = m_targetElementInstance ? m_targetElementInstance->shadowTreeElement() : 0; 617 if (!n) 618 return 0; 619 620 if (n->isSVGElement() && isDirectReference(n)) 621 return static_cast<SVGElement*>(n)->renderer(); 622 623 return 0; 624 } 625 614 626 void SVGUseElement::buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance, bool& foundProblem) 615 627 { -
trunk/WebCore/svg/SVGUseElement.h
r53879 r57511 63 63 64 64 virtual Path toClipPath() const; 65 RenderObject* rendererClipChild() const; 65 66 66 67 static void removeDisallowedElementsFromSubtree(Node* element);
Note: See TracChangeset
for help on using the changeset viewer.