Changeset 98508 in webkit
- Timestamp:
- Oct 26, 2011 11:58:59 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 94 deleted
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98507 r98508 1 2011-10-26 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Unreviewed, rolling out r98483. 4 http://trac.webkit.org/changeset/98483 5 https://bugs.webkit.org/show_bug.cgi?id=47156 6 7 Change is causing some crashes and ASSERTs. 8 9 * css2.1/20110323/background-intrinsic-001.htm: Removed. 10 * css2.1/20110323/background-intrinsic-002.htm: Removed. 11 * css2.1/20110323/background-intrinsic-003.htm: Removed. 12 * css2.1/20110323/background-intrinsic-004.htm: Removed. 13 * css2.1/20110323/background-intrinsic-005.htm: Removed. 14 * css2.1/20110323/background-intrinsic-006.htm: Removed. 15 * css2.1/20110323/background-intrinsic-007.htm: Removed. 16 * css2.1/20110323/background-intrinsic-008.htm: Removed. 17 * css2.1/20110323/background-intrinsic-009.htm: Removed. 18 * css2.1/20110323/resources/green-intrinsic-height-ratio.svg: Removed. 19 * css2.1/20110323/resources/green-intrinsic-height.svg: Removed. 20 * css2.1/20110323/resources/green-intrinsic-none.svg: Removed. 21 * css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg: Removed. 22 * css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg: Removed. 23 * css2.1/20110323/resources/green-intrinsic-width-height.svg: Removed. 24 * css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg: Removed. 25 * css2.1/20110323/resources/green-intrinsic-width-ratio.svg: Removed. 26 * css2.1/20110323/resources/green-intrinsic-width.svg: Removed. 27 * css2.1/20110323/resources/red-intrinsic-height-ratio.svg: Removed. 28 * css2.1/20110323/resources/red-intrinsic-height.svg: Removed. 29 * css2.1/20110323/resources/red-intrinsic-none.svg: Removed. 30 * css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg: Removed. 31 * css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg: Removed. 32 * css2.1/20110323/resources/red-intrinsic-width-height.svg: Removed. 33 * css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg: Removed. 34 * css2.1/20110323/resources/red-intrinsic-width-ratio.svg: Removed. 35 * css2.1/20110323/resources/red-intrinsic-width.svg: Removed. 36 * fast/backgrounds/size/contain-and-cover-zoomed.html: Removed. 37 * fast/images/percent-height-image-expected.txt: 38 * fast/images/percent-height-image.html: 39 * platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png: Added. 40 * platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png: Added. 41 * platform/mac/css1/text_properties/vertical_align-expected.txt: 42 * platform/mac/css2.1/20110323/background-intrinsic-001-expected.png: Removed. 43 * platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt: Removed. 44 * platform/mac/css2.1/20110323/background-intrinsic-002-expected.png: Removed. 45 * platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt: Removed. 46 * platform/mac/css2.1/20110323/background-intrinsic-003-expected.png: Removed. 47 * platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt: Removed. 48 * platform/mac/css2.1/20110323/background-intrinsic-004-expected.png: Removed. 49 * platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt: Removed. 50 * platform/mac/css2.1/20110323/background-intrinsic-005-expected.png: Removed. 51 * platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt: Removed. 52 * platform/mac/css2.1/20110323/background-intrinsic-006-expected.png: Removed. 53 * platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt: Removed. 54 * platform/mac/css2.1/20110323/background-intrinsic-007-expected.png: Removed. 55 * platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt: Removed. 56 * platform/mac/css2.1/20110323/background-intrinsic-008-expected.png: Removed. 57 * platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt: Removed. 58 * platform/mac/css2.1/20110323/background-intrinsic-009-expected.png: Removed. 59 * platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt: Removed. 60 * platform/mac/fast/backgrounds/size/contain-and-cover-expected.png: 61 * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png: Removed. 62 * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt: Removed. 63 * platform/mac/fast/block/float/015-expected.png: 64 * platform/mac/fast/block/float/015-expected.txt: 65 * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png: 66 * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt: 67 * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png: 68 * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt: 69 * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png: Removed. 70 * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt: Removed. 71 * platform/mac/svg/as-background-image/background-image-tiled-expected.png: Removed. 72 * platform/mac/svg/as-background-image/background-image-tiled-expected.txt: Removed. 73 * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png: Removed. 74 * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt: Removed. 75 * platform/mac/svg/as-background-image/svg-as-background-4-expected.png: 76 * platform/mac/svg/as-border-image/svg-as-border-image-expected.png: 77 * platform/mac/svg/as-image/animated-svg-as-image-expected.png: 78 * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png: Removed. 79 * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt: Removed. 80 * platform/mac/svg/as-image/same-image-two-instances-expected.png: Removed. 81 * platform/mac/svg/as-image/same-image-two-instances-expected.txt: Removed. 82 * platform/mac/svg/as-image/svg-as-relative-image-expected.png: 83 * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png: Removed. 84 * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt: Removed. 85 * platform/mac/svg/as-image/svg-image-change-content-size-expected.png: Removed. 86 * platform/mac/svg/as-image/svg-image-change-content-size-expected.txt: Removed. 87 * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png: 88 * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt: 89 * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png: Removed. 90 * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt: Removed. 91 * platform/mac/svg/zoom/page/zoom-background-images-expected.png: Removed. 92 * platform/mac/svg/zoom/page/zoom-background-images-expected.txt: Removed. 93 * platform/mac/svg/zoom/page/zoom-foreignObject-expected.png: 94 * platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt: 95 * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png: Removed. 96 * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Removed. 97 * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png: Removed. 98 * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt: Removed. 99 * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png: Removed. 100 * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt: Removed. 101 * svg/as-background-image/background-image-preserveaspectRatio-support.html: Removed. 102 * svg/as-background-image/background-image-tiled.html: Removed. 103 * svg/as-background-image/resources/construction-tape.svg: Removed. 104 * svg/as-background-image/resources/hearts.svg: 105 * svg/as-background-image/same-image-two-instances-background-image.html: Removed. 106 * svg/as-image/img-preserveAspectRatio-support-1.html: Removed. 107 * svg/as-image/resources/circle-default-meet.svg: Removed. 108 * svg/as-image/resources/circle-default-none.svg: Removed. 109 * svg/as-image/resources/circle-default-slice.svg: Removed. 110 * svg/as-image/resources/circle-nosize.svg: Removed. 111 * svg/as-image/resources/circle-viewbox-default.svg: Removed. 112 * svg/as-image/resources/circle-viewbox-meet.svg: Removed. 113 * svg/as-image/resources/circle-viewbox-none.svg: Removed. 114 * svg/as-image/resources/circle-viewbox-slice.svg: Removed. 115 * svg/as-image/resources/green-relative-size-rect.svg: 116 * svg/as-image/same-image-two-instances.html: Removed. 117 * svg/as-image/svg-as-relative-image-with-explicit-size.html: Removed. 118 * svg/as-image/svg-image-change-content-size.xhtml: Removed. 119 * svg/zoom/page/resources/relative-sized-background-with-viewBox.svg: Removed. 120 * svg/zoom/page/zoom-background-image-tiled.html: Removed. 121 * svg/zoom/page/zoom-background-images.html: Removed. 122 * svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html: Removed. 123 * svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html: Removed. 124 * svg/zoom/page/zoom-svg-as-background-with-relative-size.html: Removed. 125 1 126 2011-10-26 Eric Carlson <eric.carlson@apple.com> 2 127 -
trunk/LayoutTests/fast/images/percent-height-image-expected.txt
r98483 r98508 2 2 See Bug: http://bugs.webkit.org/show_bug.cgi?id=45439 3 3 4 PASS 4 FAIL: image height was 600 expected 20 -
trunk/LayoutTests/fast/images/percent-height-image.html
r98483 r98508 5 5 <div style="float: left;"> 6 6 <!-- src is a 20 x 20 PNG --> 7 <img style="height: 100%; width: 100%;" onload="check()"src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQ//W/8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPzdRA4AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjLX7mlDAAAAaUlEQVQoU23QQQ4AIQgDQPD/j5ZSCkYlxsPoSlnzT5mvu8yBjoPcULaAYG60RFxrDHsQVshvY6URsw8WjY2isnuZ3lTfudn5NEVFYmbN0BjWcYWVpU44kbKc2Hbg2KBMMyC85ph/HfipDQwyAn26rjFKAAAAAElFTkSuQmCC"/>7 <img style="height: 100%; width: 100%;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQ//W/8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPzdRA4AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjLX7mlDAAAAaUlEQVQoU23QQQ4AIQgDQPD/j5ZSCkYlxsPoSlnzT5mvu8yBjoPcULaAYG60RFxrDHsQVshvY6URsw8WjY2isnuZ3lTfudn5NEVFYmbN0BjWcYWVpU44kbKc2Hbg2KBMMyC85ph/HfipDQwyAn26rjFKAAAAAElFTkSuQmCC"/> 8 8 </div> 9 9 <pre></pre> 10 10 <script> 11 if (window.layoutTestController) { 12 layoutTestController.waitUntilDone(); 11 if (window.layoutTestController) 13 12 layoutTestController.dumpAsText(); 14 }15 13 16 function check() { 17 var expected = 20; 18 var actual = document.querySelector("img").offsetHeight; 19 var out = document.querySelector("pre"); 20 if (actual == expected) 21 out.textContent = "PASS"; 22 else 23 out.textContent = "FAIL: image height was " + actual + " expected " + expected; 24 layoutTestController.notifyDone(); 25 } 14 var expected = 20; 15 var actual = document.querySelector("img").offsetHeight; 16 var out = document.querySelector("pre"); 17 if (actual == expected) 18 out.textContent = "PASS"; 19 else 20 out.textContent = "FAIL: image height was " + actual + " expected " + expected; 26 21 </script> -
trunk/LayoutTests/platform/mac/css1/text_properties/vertical_align-expected.txt
r98483 r98508 173 173 RenderText {#text} at (80,122) size 101x22 174 174 text run at (80,122) width 101: " all of which " 175 RenderImage {IMG} at (181,122) size 20x65176 RenderText {#text} at (20 1,122) size 5x22177 text run at (20 1,122) width 5: " "175 RenderImage {IMG} at (181,122) size 19x65 176 RenderText {#text} at (200,122) size 5x22 177 text run at (200,122) width 5: " " 178 178 RenderInline {SPAN} at (0,0) size 262x43 179 RenderText {#text} at (20 6,105) size 262x43180 text run at (20 6,105) width 262: "should be aligned"181 RenderText {#text} at (46 8,122) size 5x22182 text run at (46 8,122) width 5: " "183 RenderImage {IMG} at (47 3,122) size 11x35184 RenderText {#text} at (48 4,122) size 123x22185 text run at (48 4,122) width 123: " with the top of "186 RenderImage {IMG} at (60 7,122) size 9x30187 RenderText {#text} at (61 6,122) size 5x22188 text run at (61 6,122) width 5: " "189 RenderInline {SPAN} at (0,0) size 73 3x144190 RenderText {#text} at (6 21,114) size 19x32191 text run at (6 21,114) width 19: "a "192 RenderInline {SPAN} at (0,0) size 73 3x194193 RenderText {#text} at (6 40,75) size 733x194194 text run at (6 40,75) width 93: "14-"179 RenderText {#text} at (205,105) size 262x43 180 text run at (205,105) width 262: "should be aligned" 181 RenderText {#text} at (467,122) size 5x22 182 text run at (467,122) width 5: " " 183 RenderImage {IMG} at (472,122) size 10x35 184 RenderText {#text} at (482,122) size 123x22 185 text run at (482,122) width 123: " with the top of " 186 RenderImage {IMG} at (605,122) size 9x30 187 RenderText {#text} at (614,122) size 5x22 188 text run at (614,122) width 5: " " 189 RenderInline {SPAN} at (0,0) size 731x144 190 RenderText {#text} at (619,114) size 19x32 191 text run at (619,114) width 19: "a " 192 RenderInline {SPAN} at (0,0) size 731x194 193 RenderText {#text} at (638,75) size 731x194 194 text run at (638,75) width 93: "14-" 195 195 text run at (0,187) width 143: "point" 196 196 RenderText {#text} at (143,226) size 144x32 … … 206 206 RenderText {#text} at (501,234) size 5x22 207 207 text run at (501,234) width 5: " " 208 RenderImage {IMG} at (506,234) size 5x15209 RenderText {#text} at (51 1,234) size 5x22210 text run at (51 1,234) width 5: " "208 RenderImage {IMG} at (506,234) size 4x15 209 RenderText {#text} at (510,234) size 5x22 210 text run at (510,234) width 5: " " 211 211 RenderInline {BIG} at (0,0) size 156x24 212 RenderText {#text} at (51 6,232) size 156x24213 text run at (51 6,232) width 156: "the images appear."214 RenderText {#text} at (67 2,234) size 5x22215 text run at (67 2,234) width 5: " "216 RenderImage {IMG} at (67 7,234) size 27x90212 RenderText {#text} at (515,232) size 156x24 213 text run at (515,232) width 156: "the images appear." 214 RenderText {#text} at (671,234) size 5x22 215 text run at (671,234) width 5: " " 216 RenderImage {IMG} at (676,234) size 27x90 217 217 RenderText {#text} at (0,0) size 0x0 218 218 RenderBlock {P} at (0,1784) size 769x36 … … 246 246 text run at (696,22) width 36: " all of" 247 247 text run at (0,98) width 43: "which " 248 RenderImage {IMG} at (43,77) size 20x65249 RenderText {#text} at (6 3,98) size 119x18250 text run at (6 3,98) width 119: " should be aligned "251 RenderImage {IMG} at (18 2,92) size 11x35252 RenderText {#text} at (19 3,98) size 4x18253 text run at (19 3,98) width 4: " "248 RenderImage {IMG} at (43,77) size 19x65 249 RenderText {#text} at (62,98) size 119x18 250 text run at (62,98) width 119: " should be aligned " 251 RenderImage {IMG} at (181,92) size 10x35 252 RenderText {#text} at (191,98) size 4x18 253 text run at (191,98) width 4: " " 254 254 RenderInline {SPAN} at (0,0) size 236x37 255 RenderText {#text} at (19 7,83) size 236x37256 text run at (19 7,83) width 236: "with the middle of"257 RenderText {#text} at (43 3,98) size 4x18258 text run at (43 3,98) width 4: " "259 RenderImage {IMG} at (43 7,84) size 15x50260 RenderText {#text} at (45 2,98) size 4x18261 text run at (45 2,98) width 4: " "262 RenderInline {SPAN} at (0,0) size 7 20x106263 RenderText {#text} at (45 6,90) size 17x28264 text run at (45 6,90) width 17: "a "255 RenderText {#text} at (195,83) size 236x37 256 text run at (195,83) width 236: "with the middle of" 257 RenderText {#text} at (431,98) size 4x18 258 text run at (431,98) width 4: " " 259 RenderImage {IMG} at (435,84) size 15x50 260 RenderText {#text} at (450,98) size 4x18 261 text run at (450,98) width 4: " " 262 RenderInline {SPAN} at (0,0) size 718x106 263 RenderText {#text} at (454,90) size 17x28 264 text run at (454,90) width 17: "a " 265 265 RenderInline {SPAN} at (0,0) size 204x69 266 RenderText {#text} at (47 3,58) size 204x69267 text run at (47 3,58) width 204: "14-point"268 RenderText {#text} at (67 7,90) size 720x106269 text run at (67 7,90) width 43: " text"266 RenderText {#text} at (471,58) size 204x69 267 text run at (471,58) width 204: "14-point" 268 RenderText {#text} at (675,90) size 718x106 269 text run at (675,90) width 43: " text" 270 270 text run at (0,168) width 78: "element" 271 271 RenderText {#text} at (78,176) size 4x18 … … 279 279 RenderText {#text} at (290,176) size 4x18 280 280 text run at (290,176) width 4: " " 281 RenderImage {IMG} at (294,180) size 5x15282 RenderText {#text} at (29 9,176) size 4x18283 text run at (29 9,176) width 4: " "281 RenderImage {IMG} at (294,180) size 4x15 282 RenderText {#text} at (298,176) size 4x18 283 text run at (298,176) width 4: " " 284 284 RenderInline {BIG} at (0,0) size 156x24 285 RenderText {#text} at (30 3,171) size 156x24286 text run at (30 3,171) width 156: "the images appear."287 RenderText {#text} at (45 9,176) size 4x18288 text run at (45 9,176) width 4: " "289 RenderImage {IMG} at (46 3,142) size 27x90285 RenderText {#text} at (302,171) size 156x24 286 text run at (302,171) width 156: "the images appear." 287 RenderText {#text} at (458,176) size 4x18 288 text run at (458,176) width 4: " " 289 RenderImage {IMG} at (462,142) size 27x90 290 290 RenderText {#text} at (0,0) size 0x0 291 291 RenderBlock {P} at (0,2084) size 769x36 … … 341 341 RenderText {#text} at (146,46) size 4x18 342 342 text run at (146,46) width 4: " " 343 RenderImage {IMG} at (150,46) size 20x65344 RenderText {#text} at (1 70,46) size 4x18345 text run at (1 70,46) width 4: " "343 RenderImage {IMG} at (150,46) size 19x65 344 RenderText {#text} at (169,46) size 4x18 345 text run at (169,46) width 4: " " 346 346 RenderInline {SPAN} at (0,0) size 111x18 347 RenderText {#text} at (17 4,46) size 111x18348 text run at (17 4,46) width 111: "should be aligned"349 RenderText {#text} at (28 5,46) size 4x18350 text run at (28 5,46) width 4: " "351 RenderImage {IMG} at (28 9,46) size 11x35352 RenderText {#text} at ( 300,46) size 4x18353 text run at ( 300,46) width 4: " "347 RenderText {#text} at (173,46) size 111x18 348 text run at (173,46) width 111: "should be aligned" 349 RenderText {#text} at (284,46) size 4x18 350 text run at (284,46) width 4: " " 351 RenderImage {IMG} at (288,46) size 10x35 352 RenderText {#text} at (298,46) size 4x18 353 text run at (298,46) width 4: " " 354 354 RenderInline {SPAN} at (0,0) size 188x37 355 RenderText {#text} at (30 4,46) size 188x37356 text run at (30 4,46) width 188: "with the top of"357 RenderText {#text} at (49 2,46) size 4x18358 text run at (49 2,46) width 4: " "359 RenderImage {IMG} at (49 6,46) size 15x50360 RenderText {#text} at (5 11,46) size 4x18361 text run at (5 11,46) width 4: " "355 RenderText {#text} at (302,46) size 188x37 356 text run at (302,46) width 188: "with the top of" 357 RenderText {#text} at (490,46) size 4x18 358 text run at (490,46) width 4: " " 359 RenderImage {IMG} at (494,46) size 15x50 360 RenderText {#text} at (509,46) size 4x18 361 text run at (509,46) width 4: " " 362 362 RenderInline {SPAN} at (0,0) size 128x18 363 RenderText {#text} at (51 5,46) size 128x18364 text run at (51 5,46) width 128: "the tallest element in"365 RenderText {#text} at (64 3,46) size 4x18366 text run at (64 3,46) width 4: " "367 RenderImage {IMG} at (64 7,46) size 5x15368 RenderText {#text} at (6 52,46) size 4x18369 text run at (6 52,46) width 4: " "370 RenderInline {BIG} at (0,0) size 74 4x89371 RenderText {#text} at (65 6,46) size 744x89372 text run at (65 6,46) width 88: "whichever"363 RenderText {#text} at (513,46) size 128x18 364 text run at (513,46) width 128: "the tallest element in" 365 RenderText {#text} at (641,46) size 4x18 366 text run at (641,46) width 4: " " 367 RenderImage {IMG} at (645,46) size 4x15 368 RenderText {#text} at (649,46) size 4x18 369 text run at (649,46) width 4: " " 370 RenderInline {BIG} at (0,0) size 741x89 371 RenderText {#text} at (653,46) size 741x89 372 text run at (653,46) width 88: "whichever" 373 373 text run at (0,111) width 208: "line the elements appear." 374 374 RenderText {#text} at (208,111) size 4x18 … … 517 517 RenderText {#text} at (80,122) size 101x22 518 518 text run at (80,122) width 101: " all of which " 519 RenderImage {IMG} at (181,122) size 20x65520 RenderText {#text} at (20 1,122) size 5x22521 text run at (20 1,122) width 5: " "519 RenderImage {IMG} at (181,122) size 19x65 520 RenderText {#text} at (200,122) size 5x22 521 text run at (200,122) width 5: " " 522 522 RenderInline {SPAN} at (0,0) size 262x43 523 RenderText {#text} at (20 6,105) size 262x43524 text run at (20 6,105) width 262: "should be aligned"525 RenderText {#text} at (46 8,122) size 5x22526 text run at (46 8,122) width 5: " "527 RenderImage {IMG} at (47 3,122) size 11x35528 RenderText {#text} at (48 4,122) size 123x22529 text run at (48 4,122) width 123: " with the top of "530 RenderImage {IMG} at (60 7,122) size 9x30531 RenderText {#text} at (61 6,122) size 5x22532 text run at (61 6,122) width 5: " "533 RenderInline {SPAN} at (0,0) size 73 3x144534 RenderText {#text} at (6 21,114) size 19x32535 text run at (6 21,114) width 19: "a "536 RenderInline {SPAN} at (0,0) size 73 3x194537 RenderText {#text} at (6 40,75) size 733x194538 text run at (6 40,75) width 93: "14-"523 RenderText {#text} at (205,105) size 262x43 524 text run at (205,105) width 262: "should be aligned" 525 RenderText {#text} at (467,122) size 5x22 526 text run at (467,122) width 5: " " 527 RenderImage {IMG} at (472,122) size 10x35 528 RenderText {#text} at (482,122) size 123x22 529 text run at (482,122) width 123: " with the top of " 530 RenderImage {IMG} at (605,122) size 9x30 531 RenderText {#text} at (614,122) size 5x22 532 text run at (614,122) width 5: " " 533 RenderInline {SPAN} at (0,0) size 731x144 534 RenderText {#text} at (619,114) size 19x32 535 text run at (619,114) width 19: "a " 536 RenderInline {SPAN} at (0,0) size 731x194 537 RenderText {#text} at (638,75) size 731x194 538 text run at (638,75) width 93: "14-" 539 539 text run at (0,187) width 143: "point" 540 540 RenderText {#text} at (143,226) size 144x32 … … 550 550 RenderText {#text} at (501,234) size 5x22 551 551 text run at (501,234) width 5: " " 552 RenderImage {IMG} at (506,234) size 5x15553 RenderText {#text} at (51 1,234) size 5x22554 text run at (51 1,234) width 5: " "552 RenderImage {IMG} at (506,234) size 4x15 553 RenderText {#text} at (510,234) size 5x22 554 text run at (510,234) width 5: " " 555 555 RenderInline {BIG} at (0,0) size 156x24 556 RenderText {#text} at (51 6,232) size 156x24557 text run at (51 6,232) width 156: "the images appear."558 RenderText {#text} at (67 2,234) size 5x22559 text run at (67 2,234) width 5: " "560 RenderImage {IMG} at (67 7,234) size 27x90556 RenderText {#text} at (515,232) size 156x24 557 text run at (515,232) width 156: "the images appear." 558 RenderText {#text} at (671,234) size 5x22 559 text run at (671,234) width 5: " " 560 RenderImage {IMG} at (676,234) size 27x90 561 561 RenderText {#text} at (0,0) size 0x0 562 562 RenderBlock {P} at (4,1453) size 747x36 … … 590 590 text run at (696,22) width 36: " all of" 591 591 text run at (0,98) width 43: "which " 592 RenderImage {IMG} at (43,77) size 20x65593 RenderText {#text} at (6 3,98) size 119x18594 text run at (6 3,98) width 119: " should be aligned "595 RenderImage {IMG} at (18 2,92) size 11x35596 RenderText {#text} at (19 3,98) size 4x18597 text run at (19 3,98) width 4: " "592 RenderImage {IMG} at (43,77) size 19x65 593 RenderText {#text} at (62,98) size 119x18 594 text run at (62,98) width 119: " should be aligned " 595 RenderImage {IMG} at (181,92) size 10x35 596 RenderText {#text} at (191,98) size 4x18 597 text run at (191,98) width 4: " " 598 598 RenderInline {SPAN} at (0,0) size 236x37 599 RenderText {#text} at (19 7,83) size 236x37600 text run at (19 7,83) width 236: "with the middle of"601 RenderText {#text} at (43 3,98) size 4x18602 text run at (43 3,98) width 4: " "603 RenderImage {IMG} at (43 7,84) size 15x50604 RenderText {#text} at (45 2,98) size 4x18605 text run at (45 2,98) width 4: " "606 RenderInline {SPAN} at (0,0) size 7 20x106607 RenderText {#text} at (45 6,90) size 17x28608 text run at (45 6,90) width 17: "a "599 RenderText {#text} at (195,83) size 236x37 600 text run at (195,83) width 236: "with the middle of" 601 RenderText {#text} at (431,98) size 4x18 602 text run at (431,98) width 4: " " 603 RenderImage {IMG} at (435,84) size 15x50 604 RenderText {#text} at (450,98) size 4x18 605 text run at (450,98) width 4: " " 606 RenderInline {SPAN} at (0,0) size 718x106 607 RenderText {#text} at (454,90) size 17x28 608 text run at (454,90) width 17: "a " 609 609 RenderInline {SPAN} at (0,0) size 204x69 610 RenderText {#text} at (47 3,58) size 204x69611 text run at (47 3,58) width 204: "14-point"612 RenderText {#text} at (67 7,90) size 720x106613 text run at (67 7,90) width 43: " text"610 RenderText {#text} at (471,58) size 204x69 611 text run at (471,58) width 204: "14-point" 612 RenderText {#text} at (675,90) size 718x106 613 text run at (675,90) width 43: " text" 614 614 text run at (0,168) width 78: "element" 615 615 RenderText {#text} at (78,176) size 4x18 … … 623 623 RenderText {#text} at (290,176) size 4x18 624 624 text run at (290,176) width 4: " " 625 RenderImage {IMG} at (294,180) size 5x15626 RenderText {#text} at (29 9,176) size 4x18627 text run at (29 9,176) width 4: " "625 RenderImage {IMG} at (294,180) size 4x15 626 RenderText {#text} at (298,176) size 4x18 627 text run at (298,176) width 4: " " 628 628 RenderInline {BIG} at (0,0) size 156x24 629 RenderText {#text} at (30 3,171) size 156x24630 text run at (30 3,171) width 156: "the images appear."631 RenderText {#text} at (45 9,176) size 4x18632 text run at (45 9,176) width 4: " "633 RenderImage {IMG} at (46 3,142) size 27x90629 RenderText {#text} at (302,171) size 156x24 630 text run at (302,171) width 156: "the images appear." 631 RenderText {#text} at (458,176) size 4x18 632 text run at (458,176) width 4: " " 633 RenderImage {IMG} at (462,142) size 27x90 634 634 RenderText {#text} at (0,0) size 0x0 635 635 RenderBlock {P} at (4,1753) size 747x36 … … 685 685 RenderText {#text} at (146,46) size 4x18 686 686 text run at (146,46) width 4: " " 687 RenderImage {IMG} at (150,46) size 20x65688 RenderText {#text} at (1 70,46) size 4x18689 text run at (1 70,46) width 4: " "687 RenderImage {IMG} at (150,46) size 19x65 688 RenderText {#text} at (169,46) size 4x18 689 text run at (169,46) width 4: " " 690 690 RenderInline {SPAN} at (0,0) size 111x18 691 RenderText {#text} at (17 4,46) size 111x18692 text run at (17 4,46) width 111: "should be aligned"693 RenderText {#text} at (28 5,46) size 4x18694 text run at (28 5,46) width 4: " "695 RenderImage {IMG} at (28 9,46) size 11x35696 RenderText {#text} at ( 300,46) size 4x18697 text run at ( 300,46) width 4: " "691 RenderText {#text} at (173,46) size 111x18 692 text run at (173,46) width 111: "should be aligned" 693 RenderText {#text} at (284,46) size 4x18 694 text run at (284,46) width 4: " " 695 RenderImage {IMG} at (288,46) size 10x35 696 RenderText {#text} at (298,46) size 4x18 697 text run at (298,46) width 4: " " 698 698 RenderInline {SPAN} at (0,0) size 188x37 699 RenderText {#text} at (30 4,46) size 188x37700 text run at (30 4,46) width 188: "with the top of"701 RenderText {#text} at (49 2,46) size 4x18702 text run at (49 2,46) width 4: " "703 RenderImage {IMG} at (49 6,46) size 15x50704 RenderText {#text} at (5 11,46) size 4x18705 text run at (5 11,46) width 4: " "699 RenderText {#text} at (302,46) size 188x37 700 text run at (302,46) width 188: "with the top of" 701 RenderText {#text} at (490,46) size 4x18 702 text run at (490,46) width 4: " " 703 RenderImage {IMG} at (494,46) size 15x50 704 RenderText {#text} at (509,46) size 4x18 705 text run at (509,46) width 4: " " 706 706 RenderInline {SPAN} at (0,0) size 128x18 707 RenderText {#text} at (51 5,46) size 128x18708 text run at (51 5,46) width 128: "the tallest element in"709 RenderText {#text} at (64 3,46) size 4x18710 text run at (64 3,46) width 4: " "711 RenderImage {IMG} at (64 7,46) size 5x15712 RenderText {#text} at (6 52,46) size 4x18713 text run at (6 52,46) width 4: " "714 RenderInline {BIG} at (0,0) size 74 4x89715 RenderText {#text} at (65 6,46) size 744x89716 text run at (65 6,46) width 88: "whichever"707 RenderText {#text} at (513,46) size 128x18 708 text run at (513,46) width 128: "the tallest element in" 709 RenderText {#text} at (641,46) size 4x18 710 text run at (641,46) width 4: " " 711 RenderImage {IMG} at (645,46) size 4x15 712 RenderText {#text} at (649,46) size 4x18 713 text run at (649,46) width 4: " " 714 RenderInline {BIG} at (0,0) size 741x89 715 RenderText {#text} at (653,46) size 741x89 716 text run at (653,46) width 88: "whichever" 717 717 text run at (0,111) width 208: "line the elements appear." 718 718 RenderText {#text} at (208,111) size 4x18 -
trunk/LayoutTests/platform/mac/fast/block/float/015-expected.txt
r98483 r98508 11 11 text run at (4,4) width 4: " " 12 12 RenderTableCell {TD} at (12,0) size 657x128 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1] 13 RenderImage {IMG} at (4,4) size 50x50 [bgcolor=#FFA500]13 RenderImage {IMG} at (4,4) size 49x50 [bgcolor=#FFA500] 14 14 RenderBlock {P} at (4,4) size 649x18 15 RenderText {#text} at (5 3,0) size 595x1816 text run at (5 3,0) width 595: "This text should be flowing past a tall orange rectangle on the left side of the browser window."15 RenderText {#text} at (52,0) size 595x18 16 text run at (52,0) width 595: "This text should be flowing past a tall orange rectangle on the left side of the browser window." 17 17 RenderBlock {DIV} at (4,38) size 649x18 [bgcolor=#008000] 18 RenderBR {BR} at (5 3,0) size 0x1819 RenderImage {IMG} at (4,56) size 50x50 [bgcolor=#FFA500]18 RenderBR {BR} at (52,0) size 0x18 19 RenderImage {IMG} at (4,56) size 49x50 [bgcolor=#FFA500] 20 20 RenderBlock {DIV} at (4,106) size 649x18 21 21 RenderText {#text} at (0,0) size 649x18 -
trunk/LayoutTests/platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt
r98483 r98508 8 8 layer at (51,140) size 560x320 9 9 RenderBlock (positioned) {DIV} at (1,40) size 560x320 [border: (1px solid #FF0000)] 10 RenderImage {IMG} at (1,1) size 39 3x31810 RenderImage {IMG} at (1,1) size 392x318 11 11 RenderText {#text} at (0,0) size 0x0 12 12 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt
r98483 r98508 12 12 RenderBlock {DIV} at (0,34) size 800x152 13 13 RenderBlock {DIV} at (0,0) size 402x152 [border: (1px solid #DDDDDD)] 14 RenderImage {IMG} at (155,1) size 9 3x10014 RenderImage {IMG} at (155,1) size 92x100 -
trunk/LayoutTests/platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt
r98483 r98508 1 layer at (0,0) size 800x6002 RenderView at (0,0) size 800x6003 layer at (0,0) size 800x6004 RenderSVGRoot {svg} at ( 6,3) size 788x5945 RenderSVGPath {rect} at ( 6,3) size 788x594 [stroke={[type=SOLID] [color=#000000]}] [x=4.63] [y=3.47] [width=453.70] [height=340.28]1 layer at (0,0) size 1357x1011 2 RenderView at (0,0) size 785x585 3 layer at (0,0) size 1357x1011 4 RenderSVGRoot {svg} at (12,8) size 1333x995 5 RenderSVGPath {rect} at (12,8) size 1333x995 [stroke={[type=SOLID] [color=#000000]}] [x=7.85] [y=5.85] [width=769.30] [height=573.30] 6 6 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt
r98483 r98508 1 layer at (0,0) size 800x6002 RenderView at (0,0) size 800x6003 layer at (0,0) size 800x6004 RenderSVGRoot {svg} at (12,12) size 788x5881 layer at (0,0) size 1131x843 2 RenderView at (0,0) size 785x585 3 layer at (0,0) size 1131x843 4 RenderSVGRoot {svg} at (12,12) size 1119x831 5 5 RenderSVGForeignObject {foreignObject} at (10,10) size 580x380 6 6 RenderBlock {xhtml:div} at (0,0) size 580x18 … … 12 12 text run at (0,0) width 66: "and a link." 13 13 RenderBR {xhtml:br} at (66,0) size 0x18 14 RenderSVGPath {rect} at (12,12) size 788x552 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]14 RenderSVGPath {rect} at (12,12) size 840x552 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00] 15 15 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 -
trunk/LayoutTests/svg/as-background-image/resources/hearts.svg
r98483 r98508 1 <svg width="100%" height="100%" preserveAspectRatio="none"viewBox="0 200 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">1 <svg width="100%" height="100%" viewBox="0 200 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg"> 2 2 <title>Suzanne's Hearts V1.0</title><desc>Author: http://richard.warburton.it - Licence: http://creativecommons.org/licenses/publicdomain</desc> 3 3 <rect x="-200" y="0" width="600" height="600" fill="black" /> -
trunk/LayoutTests/svg/as-image/resources/green-relative-size-rect.svg
r98483 r98508 1 1 <svg xmlns="http://www.w3.org/2000/svg" width='100%' height='100%'> 2 <rect fill='green' width='100%' height='100%' /> 3 <circle cx="50%" cy="50%" r="10%" fill="navy"/> 2 <rect fill='green' width='100px' height='100px' /> 4 3 </svg> -
trunk/Source/WebCore/ChangeLog
r98507 r98508 1 2011-10-26 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Unreviewed, rolling out r98483. 4 http://trac.webkit.org/changeset/98483 5 https://bugs.webkit.org/show_bug.cgi?id=47156 6 7 Change is causing some crashes and ASSERTs. 8 9 * loader/cache/CachedImage.cpp: 10 (WebCore::CachedImage::lookupImageForSize): 11 (WebCore::CachedImage::lookupImageForRenderer): 12 (WebCore::CachedImage::lookupOrCreateImageForRenderer): 13 (WebCore::CachedImage::setContainerSizeForRenderer): 14 (WebCore::CachedImage::imageSizeForRenderer): 15 (WebCore::CachedImage::computeIntrinsicDimensions): 16 (WebCore::CachedImage::createImage): 17 * loader/cache/CachedImage.h: 18 * page/ChromeClient.h: 19 * rendering/ImageBySizeCache.cpp: 20 (WebCore::ImageBySizeCache::addClient): 21 (WebCore::ImageBySizeCache::removeClient): 22 (WebCore::ImageBySizeCache::imageForSize): 23 (WebCore::ImageBySizeCache::sizeForClient): 24 * rendering/ImageBySizeCache.h: 25 * rendering/RenderBoxModelObject.cpp: 26 (WebCore::RenderBoxModelObject::calculateFillTileSize): 27 (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): 28 (WebCore::RenderBoxModelObject::paintNinePieceImage): 29 * rendering/RenderBoxModelObject.h: 30 * rendering/RenderImage.cpp: 31 (WebCore::RenderImage::RenderImage): 32 (WebCore::RenderImage::imageDimensionsChanged): 33 (WebCore::RenderImage::isLogicalWidthSpecified): 34 (WebCore::RenderImage::isLogicalHeightSpecified): 35 (WebCore::RenderImage::computeReplacedLogicalWidth): 36 (WebCore::RenderImage::computeReplacedLogicalHeight): 37 (WebCore::RenderImage::calcAspectRatioLogicalWidth): 38 (WebCore::RenderImage::calcAspectRatioLogicalHeight): 39 * rendering/RenderImage.h: 40 * rendering/RenderImageResource.cpp: 41 (WebCore::RenderImageResource::setContainerSizeForRenderer): 42 * rendering/RenderImageResourceStyleImage.cpp: 43 * rendering/RenderImageResourceStyleImage.h: 44 (WebCore::RenderImageResourceStyleImage::image): 45 (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): 46 * rendering/RenderListMarker.cpp: 47 (WebCore::RenderListMarker::computePreferredLogicalWidths): 48 * rendering/RenderReplaced.cpp: 49 (WebCore::RenderReplaced::computeIntrinsicLogicalWidth): 50 (WebCore::RenderReplaced::computeIntrinsicLogicalHeight): 51 (WebCore::RenderReplaced::computeReplacedLogicalWidth): 52 * rendering/style/StyleCachedImage.cpp: 53 (WebCore::StyleCachedImage::computeIntrinsicDimensions): 54 (WebCore::StyleCachedImage::setContainerSizeForRenderer): 55 (WebCore::StyleCachedImage::addClient): 56 (WebCore::StyleCachedImage::removeClient): 57 * rendering/style/StyleCachedImage.h: 58 * rendering/style/StyleGeneratedImage.h: 59 (WebCore::StyleGeneratedImage::setContainerSizeForRenderer): 60 * rendering/style/StyleImage.h: 61 * rendering/style/StylePendingImage.h: 62 (WebCore::StylePendingImage::setContainerSizeForRenderer): 63 * rendering/svg/RenderSVGImage.cpp: 64 (WebCore::RenderSVGImage::layout): 65 * rendering/svg/RenderSVGRoot.cpp: 66 (WebCore::RenderSVGRoot::computeIntrinsicWidth): 67 (WebCore::RenderSVGRoot::computeIntrinsicHeight): 68 (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): 69 (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): 70 (WebCore::RenderSVGRoot::layout): 71 (WebCore::RenderSVGRoot::paint): 72 (WebCore::RenderSVGRoot::calcViewport): 73 (WebCore::RenderSVGRoot::computeRectForRepaint): 74 * rendering/svg/RenderSVGRoot.h: 75 * svg/SVGLength.cpp: 76 (WebCore::SVGLength::determineViewport): 77 * svg/SVGSVGElement.cpp: 78 (WebCore::SVGSVGElement::SVGSVGElement): 79 (WebCore::SVGSVGElement::relativeWidthValue): 80 (WebCore::SVGSVGElement::relativeHeightValue): 81 (WebCore::SVGSVGElement::currentViewBoxRect): 82 * svg/SVGSVGElement.h: 83 (WebCore::SVGSVGElement::setContainerSize): 84 (WebCore::SVGSVGElement::containerSize): 85 (WebCore::SVGSVGElement::hasSetContainerSize): 86 * svg/graphics/SVGImage.cpp: 87 (WebCore::SVGImage::setContainerSize): 88 (WebCore::SVGImage::usesContainerSize): 89 (WebCore::SVGImage::size): 90 (WebCore::SVGImage::hasRelativeWidth): 91 (WebCore::SVGImage::hasRelativeHeight): 92 (WebCore::SVGImage::draw): 93 (WebCore::SVGImage::computeIntrinsicDimensions): 94 (WebCore::SVGImage::dataChanged): 95 * svg/graphics/SVGImage.h: 96 1 97 2011-10-26 Eric Carlson <eric.carlson@apple.com> 2 98 -
trunk/Source/WebCore/loader/cache/CachedImage.cpp
r98483 r98508 35 35 #include "FrameLoaderTypes.h" 36 36 #include "FrameView.h" 37 #include "RenderObject.h"38 37 #include "Settings.h" 39 38 #include "SharedBuffer.h" … … 132 131 } 133 132 134 #if ENABLE(SVG) 135 inline Image* CachedImage::lookupImageForSize(const IntSize& size) const 136 { 137 if (!m_image) 138 return 0; 139 if (!m_image->isSVGImage()) 140 return m_image.get(); 141 if (Image* image = m_svgImageCache.imageForSize(size)) 142 return image; 133 Image* CachedImage::lookupImageForSize(const IntSize& size) const 134 { 135 // FIXME: Add logic for this in webkit.org/b/47156. 136 UNUSED_PARAM(size); 143 137 return m_image.get(); 144 138 } 145 139 146 inline Image* CachedImage::lookupImageForRenderer(const RenderObject* renderer) const 147 { 148 if (!m_image) 149 return 0; 150 if (!m_image->isSVGImage()) 151 return m_image.get(); 152 if (Image* image = m_svgImageCache.imageForRenderer(renderer)) 153 return image; 140 Image* CachedImage::lookupImageForRenderer(const RenderObject* renderer) const 141 { 142 // FIXME: Add logic for this in webkit.org/b/47156. 143 UNUSED_PARAM(renderer); 154 144 return m_image.get(); 155 145 } 156 146 157 inline PassRefPtr<Image> createSVGImage(CachedImage* image, const IntSize& size, SharedBuffer* data) 158 { 159 if (size.isEmpty() || !data) 160 return SVGImage::create(image); 161 162 RefPtr<Image> newImage = SVGImage::create(image); 163 newImage->setData(data, true); 164 newImage->setContainerSize(size); 165 return newImage.release(); 166 } 167 168 inline PassRefPtr<Image> CachedImage::lookupOrCreateImageForRenderer(const RenderObject* renderer) 169 { 170 if (!m_image) 171 return 0; 172 if (!m_image->isSVGImage()) 173 return m_image; 174 175 IntSize size; 176 if (Image* result = m_svgImageCache.imageForRenderer(renderer, &size)) 177 return result; 178 179 if (size.isEmpty()) 180 return m_image; 181 182 // Create and cache new image at desired size. 183 RefPtr<Image> newImage = createSVGImage(this, size, m_data.get()); 184 m_svgImageCache.putImage(size, newImage); 185 return newImage.release(); 186 } 187 #else 188 inline Image* CachedImage::lookupImageForSize(const IntSize&) const 189 { 190 return m_image.get(); 191 } 192 193 inline Image* CachedImage::lookupImageForRenderer(const RenderObject*) const 194 { 195 return m_image.get(); 196 } 197 198 inline PassRefPtr<Image> CachedImage::lookupOrCreateImageForRenderer(const RenderObject*) 199 { 147 PassRefPtr<Image> CachedImage::lookupOrCreateImageForRenderer(const RenderObject* renderer) 148 { 149 // FIXME: Add logic for this in webkit.org/b/47156. 150 UNUSED_PARAM(renderer); 200 151 return m_image; 201 152 } 202 #endif203 153 204 154 Image* CachedImage::image() … … 236 186 } 237 187 238 void CachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& containerSize , float containerZoom)188 void CachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& containerSize) 239 189 { 240 190 if (!m_image) 241 191 return; 242 #if ENABLE(SVG) 243 if (!m_image->isSVGImage()) { 244 m_image->setContainerSize(containerSize); 245 return; 246 } 247 m_svgImageCache.setClient(renderer, containerSize); 248 249 Image* image = lookupOrCreateImageForRenderer(renderer).get(); 250 if (image && image != m_image) { 251 ASSERT(image->isSVGImage()); 252 static_cast<SVGImage*>(image)->setContainerZoom(containerZoom); 253 } 254 #else 192 193 // FIXME: Add logic for this in webkit.org/b/47156. 255 194 UNUSED_PARAM(renderer); 256 195 m_image->setContainerSize(containerSize); 257 #endif258 196 } 259 197 … … 286 224 ASSERT(!isPurgeable()); 287 225 288 if (!m_image) 226 Image* image = lookupImageForRenderer(renderer); 227 if (!image) 289 228 return IntSize(); 290 #if ENABLE(SVG)291 // SVGImages already includes the zooming in its intrinsic size.292 if (m_image->isSVGImage())293 return lookupImageForRenderer(renderer)->size();294 #endif295 296 229 if (multiplier == 1.0f) 297 230 return m_image->size(); … … 309 242 } 310 243 311 void CachedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) 312 { 313 if (m_image) 314 m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio); 315 } 316 317 void CachedImage::addClientForRenderer(RenderObject* renderer) 318 { 319 ASSERT(renderer); 320 #if ENABLE(SVG) 321 m_svgImageCache.addClient(renderer, IntSize()); 322 #endif 323 addClient(renderer); 324 } 325 326 void CachedImage::removeClientForRenderer(RenderObject* renderer) 327 { 328 ASSERT(renderer); 329 #if ENABLE(SVG) 330 m_svgImageCache.removeClient(renderer); 331 #endif 332 removeClient(renderer); 244 void CachedImage::computeIntrinsicDimensions(const RenderObject* renderer, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) 245 { 246 if (Image* image = lookupImageForRenderer(renderer)) 247 image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio); 333 248 } 334 249 … … 370 285 #if ENABLE(SVG) 371 286 if (m_response.mimeType() == "image/svg+xml") { 372 m_image = createSVGImage(this, IntSize(), 0);287 m_image = SVGImage::create(this); 373 288 return; 374 289 } -
trunk/Source/WebCore/loader/cache/CachedImage.h
r98483 r98508 58 58 59 59 bool canRender(const RenderObject* renderer, float multiplier) { return !errorOccurred() && !imageSizeForRenderer(renderer, multiplier).isEmpty(); } 60 void addClientForRenderer(RenderObject*);61 void removeClientForRenderer(RenderObject*);62 60 63 void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float); 61 // These are only used for SVGImage right now 62 void setContainerSizeForRenderer(const RenderObject*, const IntSize&); 64 63 bool usesImageContainerSize() const; 65 64 bool imageHasRelativeWidth() const; … … 68 67 // This method takes a zoom multiplier that can be used to increase the natural size of the image by the zoom. 69 68 IntSize imageSizeForRenderer(const RenderObject*, float multiplier); // returns the size of the complete image. 70 void computeIntrinsicDimensions( Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);69 void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio); 71 70 72 71 virtual void didAddClient(CachedResourceClient*); -
trunk/Source/WebCore/page/ChromeClient.h
r98483 r98508 337 337 virtual void numWheelEventHandlersChanged(unsigned) = 0; 338 338 339 virtual bool isSVGImageChromeClient() const { return false; }340 341 339 protected: 342 340 virtual ~ChromeClient() { } -
trunk/Source/WebCore/rendering/ImageBySizeCache.cpp
r98483 r98508 35 35 void ImageBySizeCache::addClient(const RenderObject* renderer, const IntSize& size) 36 36 { 37 ASSERT(renderer);38 37 if (!size.isEmpty()) 39 38 m_sizes.add(size); … … 50 49 void ImageBySizeCache::removeClient(const RenderObject* renderer) 51 50 { 52 ASSERT(renderer);53 51 RenderObjectSizeCountMap::iterator it = m_clients.find(renderer); 54 if (it == m_clients.end()) 55 return; 52 ASSERT(it != m_clients.end()); 56 53 57 54 SizeCountPair& sizeCount = it->second; … … 65 62 if (!--sizeCount.second) 66 63 m_clients.remove(renderer); 67 }68 69 void ImageBySizeCache::setClient(const RenderObject* renderer, const IntSize& size)70 {71 ASSERT(renderer);72 RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);73 if (it != m_clients.end()) {74 IntSize currentSize = it->second.first;75 if (currentSize == size)76 return;77 removeClient(renderer);78 }79 80 if (!size.isEmpty())81 addClient(renderer, size);82 64 } 83 65 … … 116 98 Image* ImageBySizeCache::imageForSize(const IntSize& size) const 117 99 { 118 if (size.isEmpty())119 return 0;120 100 HashMap<IntSize, RefPtr<Image> >::const_iterator it = m_images.find(size); 121 101 if (it == m_images.end()) … … 124 104 } 125 105 126 I mage* ImageBySizeCache::imageForRenderer(const RenderObject* renderer, IntSize* size) const106 IntSize ImageBySizeCache::sizeForClient(const RenderObject* renderer) const 127 107 { 128 if (!renderer)129 return 0;130 108 RenderObjectSizeCountMap::const_iterator it = m_clients.find(renderer); 131 109 if (it == m_clients.end()) 132 return 0; 133 if (size) 134 *size = it->second.first; 135 return imageForSize(it->second.first); 110 return IntSize(); 111 return it->second.first; 136 112 } 137 113 -
trunk/Source/WebCore/rendering/ImageBySizeCache.h
r98483 r98508 41 41 void addClient(const RenderObject*, const IntSize&); 42 42 void removeClient(const RenderObject*); 43 void setClient(const RenderObject*, const IntSize&);44 43 45 44 Image* getImage(const RenderObject*, const IntSize&); … … 49 48 50 49 Image* imageForSize(const IntSize&) const; 51 I mage* imageForRenderer(const RenderObject*, IntSize* lookedUpSize = 0) const;50 IntSize sizeForClient(const RenderObject*) const; 52 51 const RenderObjectSizeCountMap& clients() const { return m_clients; } 53 52 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r98483 r98508 783 783 } 784 784 785 static inline LayoutUnit resolveWidthForRatio(LayoutUnit height, const FloatSize& intrinsicRatio) 786 { 787 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656 788 return static_cast<LayoutUnit>(ceilf(height * intrinsicRatio.width() / intrinsicRatio.height())); 789 } 790 791 static inline LayoutUnit resolveHeightForRatio(LayoutUnit width, const FloatSize& intrinsicRatio) 792 { 793 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656 794 return static_cast<LayoutUnit>(ceilf(width * intrinsicRatio.height() / intrinsicRatio.width())); 795 } 796 797 static inline LayoutSize resolveAgainstIntrinsicWidthOrHeightAndRatio(const LayoutSize& size, const FloatSize& intrinsicRatio, LayoutUnit useWidth, LayoutUnit useHeight) 798 { 799 if (intrinsicRatio.isEmpty()) { 800 if (useWidth) 801 return LayoutSize(useWidth, size.height()); 802 return LayoutSize(size.width(), useHeight); 803 } 804 805 if (useWidth) 806 return LayoutSize(useWidth, resolveHeightForRatio(useWidth, intrinsicRatio)); 807 return LayoutSize(resolveWidthForRatio(useHeight, intrinsicRatio), useHeight); 808 } 809 810 static inline LayoutSize resolveAgainstIntrinsicRatio(const LayoutSize& size, const FloatSize& intrinsicRatio) 811 { 812 // Two possible solutions: (size.width(), solutionHeight) or (solutionWidth, size.height()) 813 // "... must be assumed to be the largest dimensions..." = easiest answer: the rect with the largest surface area. 814 815 LayoutUnit solutionWidth = resolveWidthForRatio(size.height(), intrinsicRatio); 816 LayoutUnit solutionHeight = resolveHeightForRatio(size.width(), intrinsicRatio); 817 if (solutionWidth <= size.width()) { 818 if (solutionHeight <= size.height()) { 819 // If both solutions fit, choose the one covering the larger area. 820 LayoutUnit areaOne = solutionWidth * size.height(); 821 LayoutUnit areaTwo = size.width() * solutionHeight; 822 if (areaOne < areaTwo) 823 return LayoutSize(size.width(), solutionHeight); 824 return LayoutSize(solutionWidth, size.height()); 825 } 826 827 // Only the first solution fits. 828 return LayoutSize(solutionWidth, size.height()); 829 } 830 831 // Only the second solution fits, assert that. 832 ASSERT(solutionHeight <= size.height()); 833 return LayoutSize(size.width(), solutionHeight); 834 } 835 836 LayoutSize RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize& positioningAreaSize) const 837 { 838 // This implements http://www.w3.org/TR/css3-background/#background-size. 839 LayoutUnit resolvedWidth = 0; 840 LayoutUnit resolvedHeight = 0; 841 FloatSize intrinsicRatio; 842 843 // A generated image without a fixed size, will always return the container size as intrinsic size. 844 if (image->isGeneratedImage() && image->usesImageContainerSize()) { 845 resolvedWidth = positioningAreaSize.width(); 846 resolvedHeight = positioningAreaSize.height(); 847 } else { 848 Length intrinsicWidth; 849 Length intrinsicHeight; 850 image->computeIntrinsicDimensions(this, intrinsicWidth, intrinsicHeight, intrinsicRatio); 851 852 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656 853 if (intrinsicWidth.isFixed()) 854 resolvedWidth = static_cast<LayoutUnit>(ceilf(intrinsicWidth.value() * style()->effectiveZoom())); 855 if (intrinsicHeight.isFixed()) 856 resolvedHeight = static_cast<LayoutUnit>(ceilf(intrinsicHeight.value() * style()->effectiveZoom())); 857 } 858 859 // Intrinsic dimensions expressed as percentages must be resolved relative to the dimensions of the rectangle 860 // that establishes the coordinate system for the 'background-position' property. SVG on the other hand 861 // _explicitely_ says that percentage values for the width/height attributes do NOT define intrinsic dimensions. 862 if (resolvedWidth > 0 && resolvedHeight > 0) 863 return LayoutSize(resolvedWidth, resolvedHeight); 864 865 // If the image has one of either an intrinsic width or an intrinsic height: 866 // * and an intrinsic aspect ratio, then the missing dimension is calculated from the given dimension and the ratio. 867 // * and no intrinsic aspect ratio, then the missing dimension is assumed to be the size of the rectangle that 868 // establishes the coordinate system for the 'background-position' property. 869 if ((resolvedWidth && !resolvedHeight) || (!resolvedWidth && resolvedHeight)) 870 return resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedWidth, resolvedHeight); 871 872 // If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the 873 // largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that 874 // establishes the coordinate system for the 'background-position' property. 875 if (!resolvedWidth && !resolvedHeight && !intrinsicRatio.isEmpty()) 876 return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio); 877 878 // If the image has no intrinsic ratio either, then the dimensions must be assumed to be the rectangle that 879 // establishes the coordinate system for the 'background-position' property. 880 return positioningAreaSize; 881 } 882 883 LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer, const LayoutSize& positioningAreaSize) const 785 LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer, LayoutSize positioningAreaSize) const 884 786 { 885 787 StyleImage* image = fillLayer->image(); 788 image->setContainerSizeForRenderer(this, positioningAreaSize); // Use the box established by background-origin. 789 886 790 EFillSizeType type = fillLayer->size().type; 887 888 LayoutSize imageIntrinsicSize = calculateImageIntrinsicDimensions(image, positioningAreaSize);889 791 890 792 switch (type) { … … 909 811 // scale to maintain our aspect ratio. 910 812 if (layerWidth.isAuto() && !layerHeight.isAuto()) { 813 LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom()); 911 814 if (imageIntrinsicSize.height()) 912 815 w = imageIntrinsicSize.width() * h / imageIntrinsicSize.height(); 913 816 } else if (!layerWidth.isAuto() && layerHeight.isAuto()) { 817 LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom()); 914 818 if (imageIntrinsicSize.width()) 915 819 h = imageIntrinsicSize.height() * w / imageIntrinsicSize.width(); 916 820 } else if (layerWidth.isAuto() && layerHeight.isAuto()) { 917 821 // If both width and height are auto, use the image's intrinsic size. 822 LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom()); 918 823 w = imageIntrinsicSize.width(); 919 824 h = imageIntrinsicSize.height(); … … 922 827 return LayoutSize(max<LayoutUnit>(1, w), max<LayoutUnit>(1, h)); 923 828 } 924 case SizeNone: {925 // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.926 if (!imageIntrinsicSize.isEmpty())927 return imageIntrinsicSize;928 929 // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for ‘contain’.930 type = Contain;931 }932 829 case Contain: 933 830 case Cover: { 831 LayoutSize imageIntrinsicSize = image->imageSize(this, 1); 934 832 float horizontalScaleFactor = imageIntrinsicSize.width() 935 833 ? static_cast<float>(positioningAreaSize.width()) / imageIntrinsicSize.width() : 1; … … 938 836 float scaleFactor = type == Contain ? min(horizontalScaleFactor, verticalScaleFactor) : max(horizontalScaleFactor, verticalScaleFactor); 939 837 return LayoutSize(max<LayoutUnit>(1, imageIntrinsicSize.width() * scaleFactor), max<LayoutUnit>(1, imageIntrinsicSize.height() * scaleFactor)); 940 } 941 } 942 943 ASSERT_NOT_REACHED(); 944 return LayoutSize(); 838 } 839 case SizeNone: 840 break; 841 } 842 843 return image->imageSize(this, style()->effectiveZoom()); 945 844 } 946 845 … … 1029 928 } 1030 929 1031 LayoutSize fillTileSize = calculateFillTileSize(fillLayer, positioningAreaSize); 1032 fillLayer->image()->setContainerSizeForRenderer(this, fillTileSize, style()->effectiveZoom()); 1033 geometry.setTileSize(fillTileSize); 930 geometry.setTileSize(calculateFillTileSize(fillLayer, positioningAreaSize)); 1034 931 1035 932 EFillRepeat backgroundRepeatX = fillLayer->repeatX(); … … 1091 988 LayoutRect borderImageRect = LayoutRect(leftWithOutset, topWithOutset, rightWithOutset - leftWithOutset, bottomWithOutset - topWithOutset); 1092 989 1093 LayoutSize imageSize = calculateImageIntrinsicDimensions(styleImage, borderImageRect.size()); 1094 1095 // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any. 1096 LayoutSize containerSize = imageSize.isEmpty() ? borderImageRect.size() : imageSize; 1097 styleImage->setContainerSizeForRenderer(this, containerSize, style->effectiveZoom()); 1098 990 styleImage->setContainerSizeForRenderer(this, borderImageRect.size()); 991 LayoutSize imageSize = styleImage->imageSize(this, 1.0f); 1099 992 LayoutUnit imageWidth = imageSize.width(); 1100 993 LayoutUnit imageHeight = imageSize.height(); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r98483 r98508 196 196 virtual bool isBoxModelObject() const { return true; } 197 197 198 LayoutSize calculateFillTileSize(const FillLayer*, const LayoutSize& scaledPositioningAreaSize) const; 199 LayoutSize calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize& scaledPositioningAreaSize) const; 198 LayoutSize calculateFillTileSize(const FillLayer*, LayoutSize scaledSize) const; 200 199 201 200 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHeight, -
trunk/Source/WebCore/rendering/RenderImage.cpp
r98483 r98508 42 42 #include "RenderLayer.h" 43 43 #include "RenderView.h" 44 #include "SVGImage.h"45 44 #include <wtf/UnusedParam.h> 46 45 … … 52 51 53 52 RenderImage::RenderImage(Node* node) 54 : RenderReplaced(node, IntSize( ))53 : RenderReplaced(node, IntSize(0, 0)) 55 54 , m_needsToSetSizeForAltText(false) 56 55 , m_didIncrementVisuallyNonEmptyPixelCount(false) … … 175 174 } 176 175 177 bool RenderImage::updateIntrinsicSizeIfNeeded(bool imageSizeChanged)178 {179 if (m_imageResource->imageSize(style()->effectiveZoom()) == intrinsicSize() && !imageSizeChanged)180 return false;181 if (m_imageResource->errorOccurred())182 return imageSizeChanged;183 setIntrinsicSize(m_imageResource->imageSize(style()->effectiveZoom()));184 return true;185 }186 187 176 void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect) 188 177 { 189 178 bool shouldRepaint = true; 190 if (updateIntrinsicSizeIfNeeded(imageSizeChanged)) { 179 180 if (m_imageResource->imageSize(style()->effectiveZoom()) != intrinsicSize() || imageSizeChanged) { 181 if (!m_imageResource->errorOccurred()) 182 setIntrinsicSize(m_imageResource->imageSize(style()->effectiveZoom())); 183 191 184 // In the case of generated image content using :before/:after, we might not be in the 192 185 // render tree yet. In that case, we don't need to worry about check for layout, since we'll get a … … 483 476 } 484 477 478 bool RenderImage::isLogicalWidthSpecified() const 479 { 480 switch (style()->logicalWidth().type()) { 481 case Fixed: 482 case Percent: 483 return true; 484 case Auto: 485 case Relative: // FIXME: Shouldn't this case return true? 486 case Intrinsic: 487 case MinIntrinsic: 488 return false; 489 case Undefined: 490 ASSERT_NOT_REACHED(); 491 return false; 492 } 493 ASSERT_NOT_REACHED(); 494 return false; 495 } 496 497 bool RenderImage::isLogicalHeightSpecified() const 498 { 499 switch (style()->logicalHeight().type()) { 500 case Fixed: 501 case Percent: 502 return true; 503 case Auto: 504 case Relative: // FIXME: Shouldn't this case return true? 505 case Intrinsic: 506 case MinIntrinsic: 507 return false; 508 case Undefined: 509 ASSERT_NOT_REACHED(); 510 return false; 511 } 512 ASSERT_NOT_REACHED(); 513 return false; 514 } 515 485 516 LayoutUnit RenderImage::computeReplacedLogicalWidth(bool includeMaxWidth) const 486 517 { 487 // If we've got an explicit width/height assigned, propagate it to the image resource. 488 if (style()->logicalWidth().isFixed() && style()->logicalHeight().isFixed()) { 489 LayoutUnit width = RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth); 490 m_imageResource->setContainerSizeForRenderer(IntSize(width, computeReplacedLogicalHeight())); 491 return width; 492 } 493 494 // Propagate the containing block size to the image resource, otherwhise we can't compute our own intrinsic size, if it's relative. 495 RenderBox* contentRenderer = embeddedContentBox(); 496 bool hasRelativeWidth = contentRenderer ? contentRenderer->style()->width().isPercent() : m_imageResource->imageHasRelativeWidth(); 497 bool hasRelativeHeight = contentRenderer ? contentRenderer->style()->height().isPercent() : m_imageResource->imageHasRelativeHeight(); 498 499 if (hasRelativeWidth || hasRelativeHeight) { 500 RenderObject* containingBlock = isPositioned() ? container() : this->containingBlock(); 501 if (containingBlock->isBox()) { 502 RenderBox* box = toRenderBox(containingBlock); 503 m_imageResource->setContainerSizeForRenderer(IntSize(box->availableWidth(), box->availableHeight())); // Already contains zooming information. 504 const_cast<RenderImage*>(this)->updateIntrinsicSizeIfNeeded(false); 518 if (m_imageResource->imageHasRelativeWidth()) 519 if (RenderObject* cb = isPositioned() ? container() : containingBlock()) { 520 if (cb->isBox()) 521 m_imageResource->setContainerSizeForRenderer(LayoutSize(toRenderBox(cb)->availableWidth(), toRenderBox(cb)->availableHeight())); 505 522 } 506 } 507 508 return RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth); 509 } 510 511 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const 512 { 513 // Assure this method is never used for SVGImages. 514 ASSERT(!embeddedContentBox()); 515 isPercentageIntrinsicSize = false; 516 if (m_imageResource && m_imageResource->image()) 517 intrinsicRatio = m_imageResource->image()->size(); 518 } 519 520 bool RenderImage::needsPreferredWidthsRecalculation() const 521 { 522 if (RenderReplaced::needsPreferredWidthsRecalculation()) 523 return true; 524 return embeddedContentBox(); 525 } 526 527 RenderBox* RenderImage::embeddedContentBox() const 528 { 529 if (!m_imageResource) 523 524 LayoutUnit logicalWidth; 525 if (isLogicalWidthSpecified()) 526 logicalWidth = computeReplacedLogicalWidthUsing(style()->logicalWidth()); 527 else if (m_imageResource->usesImageContainerSize()) { 528 LayoutSize size = m_imageResource->imageSize(style()->effectiveZoom()); 529 logicalWidth = style()->isHorizontalWritingMode() ? size.width() : size.height(); 530 } else if (m_imageResource->imageHasRelativeWidth()) 531 logicalWidth = 0; // If the image is relatively-sized, set the width to 0 until there is a set container size. 532 else 533 logicalWidth = calcAspectRatioLogicalWidth(); 534 535 return computeReplacedLogicalWidthRespectingMinMaxWidth(logicalWidth, includeMaxWidth); 536 } 537 538 LayoutUnit RenderImage::computeReplacedLogicalHeight() const 539 { 540 // FIXME: This function should use RenderReplaced::computeReplacedLogicalHeight() 541 LayoutUnit logicalHeight; 542 if (logicalHeightIsAuto() && !style()->logicalWidth().isAuto() && intrinsicLogicalWidth() && intrinsicLogicalHeight()) 543 logicalHeight = static_cast<LayoutUnit>(availableLogicalWidth() * intrinsicLogicalHeight() / intrinsicLogicalWidth()); 544 else if (isLogicalHeightSpecified()) 545 logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight()); 546 else if (m_imageResource->usesImageContainerSize()) { 547 LayoutSize size = m_imageResource->imageSize(style()->effectiveZoom()); 548 logicalHeight = style()->isHorizontalWritingMode() ? size.height() : size.width(); 549 } else if (m_imageResource->imageHasRelativeHeight()) 550 logicalHeight = 0; // If the image is relatively-sized, set the height to 0 until there is a set container size. 551 else 552 logicalHeight = calcAspectRatioLogicalHeight(); 553 554 return computeReplacedLogicalHeightRespectingMinMaxHeight(logicalHeight); 555 } 556 557 int RenderImage::calcAspectRatioLogicalWidth() const 558 { 559 int intrinsicWidth = intrinsicLogicalWidth(); 560 int intrinsicHeight = intrinsicLogicalHeight(); 561 if (!intrinsicHeight) 530 562 return 0; 531 532 RefPtr<Image> image = m_imageResource->image(); 533 if (image && image->isSVGImage()) 534 return static_pointer_cast<SVGImage>(image)->embeddedContentBox(); 535 536 return 0; 563 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) 564 return intrinsicWidth; // Don't bother scaling. 565 return RenderBox::computeReplacedLogicalHeight() * intrinsicWidth / intrinsicHeight; 566 } 567 568 int RenderImage::calcAspectRatioLogicalHeight() const 569 { 570 int intrinsicWidth = intrinsicLogicalWidth(); 571 int intrinsicHeight = intrinsicLogicalHeight(); 572 if (!intrinsicWidth) 573 return 0; 574 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) 575 return intrinsicHeight; // Don't bother scaling. 576 return RenderBox::computeReplacedLogicalWidth() * intrinsicHeight / intrinsicWidth; 537 577 } 538 578 -
trunk/Source/WebCore/rendering/RenderImage.h
r98483 r98508 55 55 56 56 protected: 57 virtual bool needsPreferredWidthsRecalculation() const;58 virtual RenderBox* embeddedContentBox() const;59 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const;60 61 57 virtual void styleDidChange(StyleDifference, const RenderStyle*); 62 58 … … 65 61 virtual void paintIntoRect(GraphicsContext*, const IntRect&); 66 62 virtual void paint(PaintInfo&, const LayoutPoint&); 63 64 bool isLogicalWidthSpecified() const; 65 bool isLogicalHeightSpecified() const; 67 66 68 67 virtual void intrinsicSizeChanged() … … 88 87 89 88 virtual LayoutUnit computeReplacedLogicalWidth(bool includeMaxWidth = true) const; 89 virtual LayoutUnit computeReplacedLogicalHeight() const; 90 90 91 91 IntSize imageSizeForError(CachedImage*) const; 92 92 void imageDimensionsChanged(bool imageSizeChanged, const IntRect* = 0); 93 bool updateIntrinsicSizeIfNeeded(bool imageSizeChanged); 93 94 int calcAspectRatioLogicalWidth() const; 95 int calcAspectRatioLogicalHeight() const; 94 96 95 97 void paintAreaElementFocusRing(PaintInfo&); -
trunk/Source/WebCore/rendering/RenderImageResource.cpp
r98483 r98508 94 94 ASSERT(m_renderer); 95 95 if (m_cachedImage) 96 m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize , m_renderer->style()->effectiveZoom());96 m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize); 97 97 } 98 98 -
trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
r98483 r98508 61 61 } 62 62 63 PassRefPtr<Image> RenderImageResourceStyleImage::image(int width, int height) const64 {65 // Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit.66 if (m_styleImage->isPendingImage())67 return 0;68 return m_styleImage->image(m_renderer, IntSize(width, height));69 }70 71 void RenderImageResourceStyleImage::setContainerSizeForRenderer(const IntSize& size)72 {73 ASSERT(m_renderer);74 m_styleImage->setContainerSizeForRenderer(m_renderer, size, m_renderer->style()->effectiveZoom());75 }76 77 63 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h
r98483 r98508 47 47 48 48 virtual bool hasImage() const { return true; } 49 virtual PassRefPtr<Image> image(int width = 0, int height = 0) const ;49 virtual PassRefPtr<Image> image(int width = 0, int height = 0) const { return m_styleImage->image(m_renderer, IntSize(width, height)); } 50 50 virtual bool errorOccurred() const { return m_styleImage->errorOccurred(); } 51 51 52 virtual void setContainerSizeForRenderer(const IntSize& );52 virtual void setContainerSizeForRenderer(const IntSize& size) { m_styleImage->setContainerSizeForRenderer(m_renderer, size); } 53 53 virtual bool usesImageContainerSize() const { return m_styleImage->usesImageContainerSize(); } 54 54 virtual bool imageHasRelativeWidth() const { return m_styleImage->imageHasRelativeWidth(); } -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r98483 r98508 1351 1351 // until we support the CSS3 marker pseudoclass to allow control over the width and height of the marker box. 1352 1352 LayoutUnit bulletWidth = fontMetrics.ascent() / 2; 1353 m_image->setContainerSizeForRenderer(this, LayoutSize(bulletWidth, bulletWidth) , style()->effectiveZoom());1353 m_image->setContainerSizeForRenderer(this, LayoutSize(bulletWidth, bulletWidth)); 1354 1354 LayoutSize imageSize = m_image->imageSize(this, style()->effectiveZoom()); 1355 1355 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style()->isHorizontalWritingMode() ? imageSize.width() : imageSize.height(); -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r98483 r98508 202 202 { 203 203 if (m_hasIntrinsicSize) { 204 if (!contentRenderer || !contentRenderer->style()->logicalWidth().isFixed())205 204 ASSERT(!contentRenderer); 205 return computeReplacedLogicalWidthRespectingMinMaxWidth(calcAspectRatioLogicalWidth(), includeMaxWidth); 206 206 } 207 207 ASSERT(contentRenderer); … … 213 213 { 214 214 if (m_hasIntrinsicSize) { 215 if (!contentRenderer || !contentRenderer->style()->logicalHeight().isFixed())216 215 ASSERT(!contentRenderer); 216 return computeReplacedLogicalHeightRespectingMinMaxHeight(calcAspectRatioLogicalHeight()); 217 217 } 218 218 ASSERT(contentRenderer); … … 236 236 contentRenderStyle = contentRenderer->style(); 237 237 ASSERT(contentRenderStyle); 238 } else 239 computeIntrinsicRatioInformation(intrinsicRatio, isPercentageIntrinsicSize); 238 } 240 239 241 240 if (style()->logicalWidth().isAuto()) { -
trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp
r98483 r98508 65 65 } 66 66 67 void StyleCachedImage::computeIntrinsicDimensions(const RenderObject* , Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)67 void StyleCachedImage::computeIntrinsicDimensions(const RenderObject* renderer, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) 68 68 { 69 m_image->computeIntrinsicDimensions( intrinsicWidth, intrinsicHeight, intrinsicRatio);69 m_image->computeIntrinsicDimensions(renderer, intrinsicWidth, intrinsicHeight, intrinsicRatio); 70 70 } 71 71 … … 75 75 } 76 76 77 void StyleCachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& imageContainerSize , float imageContainerZoomFactor)77 void StyleCachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& imageContainerSize) 78 78 { 79 m_image->setContainerSizeForRenderer(renderer, imageContainerSize , imageContainerZoomFactor);79 m_image->setContainerSizeForRenderer(renderer, imageContainerSize); 80 80 } 81 81 82 82 void StyleCachedImage::addClient(RenderObject* renderer) 83 83 { 84 m_image->addClient ForRenderer(renderer);84 m_image->addClient(renderer); 85 85 } 86 86 87 87 void StyleCachedImage::removeClient(RenderObject* renderer) 88 88 { 89 m_image->removeClient ForRenderer(renderer);89 m_image->removeClient(renderer); 90 90 } 91 91 -
trunk/Source/WebCore/rendering/style/StyleCachedImage.h
r98483 r98508 49 49 virtual void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio); 50 50 virtual bool usesImageContainerSize() const; 51 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& , float);51 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&); 52 52 virtual void addClient(RenderObject*); 53 53 virtual void removeClient(RenderObject*); -
trunk/Source/WebCore/rendering/style/StyleGeneratedImage.h
r98483 r98508 48 48 virtual void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio); 49 49 virtual bool usesImageContainerSize() const { return !m_fixedSize; } 50 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& containerSize , float) { m_containerSize = containerSize; }50 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& containerSize) { m_containerSize = containerSize; } 51 51 virtual void addClient(RenderObject*); 52 52 virtual void removeClient(RenderObject*); -
trunk/Source/WebCore/rendering/style/StyleImage.h
r98483 r98508 58 58 virtual bool imageHasRelativeHeight() const = 0; 59 59 virtual bool usesImageContainerSize() const = 0; 60 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& , float) = 0;60 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&) = 0; 61 61 virtual void addClient(RenderObject*) = 0; 62 62 virtual void removeClient(RenderObject*) = 0; -
trunk/Source/WebCore/rendering/style/StylePendingImage.h
r98483 r98508 50 50 virtual void computeIntrinsicDimensions(const RenderObject*, Length& /* intrinsicWidth */ , Length& /* intrinsicHeight */, FloatSize& /* intrinsicRatio */) { } 51 51 virtual bool usesImageContainerSize() const { return false; } 52 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& , float) { }52 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&) { } 53 53 virtual void addClient(RenderObject*) { } 54 54 virtual void removeClient(RenderObject*) { } -
trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp
r98483 r98508 67 67 LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout()); 68 68 SVGImageElement* image = static_cast<SVGImageElement*>(node()); 69 m_imageResource->setContainerSizeForRenderer(enclosingIntRect(m_objectBoundingBox).size());70 69 71 70 bool transformOrBoundariesUpdate = m_needsTransformUpdate || m_updateCachedRepaintRect; -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r98483 r98508 27 27 #include "RenderSVGRoot.h" 28 28 29 #include "Chrome.h"30 #include "ChromeClient.h"31 29 #include "Frame.h" 32 30 #include "GraphicsContext.h" 33 31 #include "HitTestResult.h" 34 32 #include "LayoutRepainter.h" 35 #include "Page.h"36 33 #include "RenderPart.h" 37 34 #include "RenderSVGContainer.h" … … 118 115 } 119 116 120 bool RenderSVGRoot::isEmbeddedThroughImageElement() const 121 { 122 if (!node()) 123 return false; 124 125 Frame* frame = node()->document()->frame(); 126 if (!frame) 127 return false; 128 129 // Test whether we're embedded through an img. 130 if (!frame->page() || !frame->page()->chrome()) 131 return false; 132 133 ChromeClient* chromeClient = frame->page()->chrome()->client(); 134 if (!chromeClient || !chromeClient->isSVGImageChromeClient()) 135 return false; 136 137 return true; 117 LayoutUnit RenderSVGRoot::computeIntrinsicWidth(LayoutUnit replacedWidth) const 118 { 119 if (!style()->width().isPercent()) 120 return replacedWidth; 121 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656 122 return static_cast<int>(ceilf(replacedWidth * style()->effectiveZoom())); 123 } 124 125 LayoutUnit RenderSVGRoot::computeIntrinsicHeight(LayoutUnit replacedHeight) const 126 { 127 if (!style()->height().isPercent()) 128 return replacedHeight; 129 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656 130 return static_cast<int>(ceilf(replacedHeight * style()->effectiveZoom())); 138 131 } 139 132 … … 149 142 LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(bool includeMaxWidth) const 150 143 { 151 // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size. 152 LayoutUnit replacedWidth = m_containerSize.width(); 153 if (replacedWidth > 0) 154 return replacedWidth; 155 156 replacedWidth = RenderBox::computeReplacedLogicalWidth(includeMaxWidth); 144 LayoutUnit replacedWidth = RenderBox::computeReplacedLogicalWidth(includeMaxWidth); 157 145 Frame* frame = node() && node()->document() ? node()->document()->frame() : 0; 158 146 if (!frame) 159 return replacedWidth;147 return computeIntrinsicWidth(replacedWidth); 160 148 161 149 if (isEmbeddedThroughFrameContainingSVGDocument(frame)) 162 return replacedWidth;150 return computeIntrinsicWidth(replacedWidth); 163 151 164 152 RenderPart* ownerRenderer = frame->ownerRenderer(); … … 194 182 LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const 195 183 { 196 // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size. 197 LayoutUnit replacedHeight = m_containerSize.height(); 198 if (replacedHeight > 0) 199 return replacedHeight; 200 201 replacedHeight = RenderBox::computeReplacedLogicalHeight(); 184 LayoutUnit replacedHeight = RenderBox::computeReplacedLogicalHeight(); 185 202 186 Frame* frame = node() && node()->document() ? node()->document()->frame() : 0; 203 187 if (!frame) 204 return replacedHeight;188 return computeIntrinsicHeight(replacedHeight); 205 189 206 190 if (isEmbeddedThroughFrameContainingSVGDocument(frame)) 207 return replacedHeight;191 return computeIntrinsicHeight(replacedHeight); 208 192 209 193 RenderPart* ownerRenderer = frame->ownerRenderer(); … … 237 221 computeLogicalWidth(); 238 222 computeLogicalHeight(); 223 calcViewport(); 239 224 240 225 SVGSVGElement* svg = static_cast<SVGSVGElement*>(node()); 241 m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());242 226 m_isLayoutSizeChanged = svg->hasRelativeLengths() && oldSize != size(); 227 243 228 if (view() && view()->frameView() && view()->frameView()->embeddedContentBox()) { 244 229 if (!m_needsSizeNegotiationWithHostDocument) … … 286 271 return; 287 272 288 // An empty viewport disables rendering. 289 if ( borderBoxRect().isEmpty())273 // An empty viewport disables rendering. FIXME: Should we still render filters? 274 if (m_viewportSize.isEmpty()) 290 275 return; 291 276 … … 344 329 RenderBox::updateFromElement(); 345 330 SVGResourcesCache::clientUpdatedFromElement(this, style()); 331 } 332 333 void RenderSVGRoot::calcViewport() 334 { 335 SVGSVGElement* svg = static_cast<SVGSVGElement*>(node()); 336 337 if (!svg->hasSetContainerSize()) { 338 // In the normal case of <svg> being stand-alone or in a CSSBoxModel object we use 339 // RenderBox::width()/height() (which pulls data from RenderStyle) 340 m_viewportSize = FloatSize(width(), height()); 341 return; 342 } 343 344 // In the SVGImage case grab the SVGLength values off of SVGSVGElement and use 345 // the special relativeWidthValue accessors which respect the specified containerSize 346 // FIXME: Check how SVGImage + zooming is supposed to be handled? 347 SVGLength width = svg->width(); 348 SVGLength height = svg->height(); 349 m_viewportSize = FloatSize(width.unitType() == LengthTypePercentage ? svg->relativeWidthValue() : width.value(svg), 350 height.unitType() == LengthTypePercentage ? svg->relativeHeightValue() : height.value(svg)); 346 351 } 347 352 … … 394 399 395 400 // Apply initial viewport clip - not affected by overflow settings 396 repaintRect.intersect( borderBoxRect());401 repaintRect.intersect(enclosingLayoutRect(FloatRect(FloatPoint(), m_viewportSize))); 397 402 398 403 const SVGRenderStyle* svgStyle = style()->svgStyle(); -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h
r98483 r98508 32 32 namespace WebCore { 33 33 34 class SVGStyledElement; 34 35 class AffineTransform; 35 class SVGStyledElement;36 36 37 37 class RenderSVGRoot : public RenderBox { … … 39 39 explicit RenderSVGRoot(SVGStyledElement*); 40 40 virtual ~RenderSVGRoot(); 41 42 bool isEmbeddedThroughImageElement() const;43 41 44 42 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const; … … 58 56 virtual void setNeedsTransformUpdate() { m_needsBoundariesOrTransformUpdate = true; } 59 57 60 IntSize containerSize() const { return m_containerSize; } 61 void setContainerSize(const IntSize& containerSize) { m_containerSize = containerSize; } 58 private: 59 LayoutUnit computeIntrinsicWidth(LayoutUnit replacedWidth) const; 60 LayoutUnit computeIntrinsicHeight(LayoutUnit replacedHeight) const; 62 61 63 private:64 62 virtual RenderObjectChildList* virtualChildren() { return children(); } 65 63 virtual const RenderObjectChildList* virtualChildren() const { return children(); } … … 95 93 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const; 96 94 95 void calcViewport(); 96 97 97 bool selfWillPaint(); 98 98 void updateCachedBoundaries(); … … 104 104 105 105 RenderObjectChildList m_children; 106 IntSize m_containerSize;106 FloatSize m_viewportSize; 107 107 FloatRect m_objectBoundingBox; 108 108 FloatRect m_strokeBoundingBox; -
trunk/Source/WebCore/svg/SVGLength.cpp
r98483 r98508 29 29 #include "Frame.h" 30 30 #include "FrameView.h" 31 #include "RenderObject.h" 31 32 #include "RenderPart.h" 32 #include "RenderSVGRoot.h"33 33 #include "RenderView.h" 34 34 #include "SVGException.h" … … 361 361 return false; 362 362 363 // SVGs embedded through <object> resolve percentage values against the owner renderer in the host document.364 363 if (RenderPart* ownerRenderer = frame->ownerRenderer()) { 365 364 width = ownerRenderer->width(); … … 373 372 return false; 374 373 375 // Always resolve percentages against the unscaled viewport, as agreed across browsers.376 float zoom = view->style()->effectiveZoom();377 374 width = view->viewWidth(); 378 375 height = view->viewHeight(); 379 if (zoom != 1) {380 width /= zoom;381 height /= zoom;382 }383 376 return true; 384 377 } … … 388 381 if (viewportElement && viewportElement->isSVG()) { 389 382 const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(viewportElement); 390 FloatRect viewBox = svg->currentViewBoxRect(); 391 if (viewBox.isEmpty()) { 383 if (svg->hasAttribute(SVGNames::viewBoxAttr)) { 384 width = svg->viewBox().width(); 385 height = svg->viewBox().height(); 386 } else { 392 387 width = svg->width().value(svg); 393 388 height = svg->height().value(svg); 394 } else {395 width = viewBox.width();396 height = viewBox.height();397 389 } 398 390 -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r98483 r98508 88 88 , m_useCurrentView(false) 89 89 , m_timeContainer(SMILTimeContainer::create(this)) 90 , m_containerSize(300, 150) 91 , m_hasSetContainerSize(false) 90 92 { 91 93 ASSERT(hasTagName(SVGNames::svgTag)); … … 151 153 viewRectangle.setSize(FloatSize(width().value(this), height().value(this))); 152 154 return viewBoxToViewTransform(viewRectangle.width(), viewRectangle.height()).mapRect(viewRectangle); 155 } 156 157 int SVGSVGElement::relativeWidthValue() const 158 { 159 SVGLength w = width(); 160 if (w.unitType() != LengthTypePercentage) 161 return 0; 162 163 return static_cast<int>(w.valueAsPercentage() * m_containerSize.width()); 164 } 165 166 int SVGSVGElement::relativeHeightValue() const 167 { 168 SVGLength h = height(); 169 if (h.unitType() != LengthTypePercentage) 170 return 0; 171 172 return static_cast<int>(h.valueAsPercentage() * m_containerSize.height()); 153 173 } 154 174 … … 560 580 } 561 581 562 // Synthesize a viewBox if we're embedded through a <img> element, if none is present. 563 FloatRect useViewBox = viewBox(); 564 if (useViewBox.isEmpty() && width().unitType() != LengthTypePercentage && height().unitType() != LengthTypePercentage) { 565 if (RenderObject* renderer = this->renderer()) { 566 if (renderer->isSVGRoot() && toRenderSVGRoot(renderer)->isEmbeddedThroughImageElement()) 567 useViewBox = FloatRect(0, 0, width().value(this), height().value(this)); 568 } 569 } 570 571 return useViewBox; 582 return viewBox(); 572 583 } 573 584 -
trunk/Source/WebCore/svg/SVGSVGElement.h
r98483 r98508 63 63 64 64 FloatRect viewport() const; 65 66 void setContainerSize(const LayoutSize& containerSize) { m_containerSize = containerSize; m_hasSetContainerSize = true; } 67 LayoutSize containerSize() const { return m_containerSize; } 68 bool hasSetContainerSize() const { return m_hasSetContainerSize; } 69 int relativeWidthValue() const; 70 int relativeHeightValue() const; 65 71 66 72 float pixelUnitToMillimeterX() const; … … 176 182 FloatPoint m_translation; 177 183 mutable OwnPtr<SVGViewSpec> m_viewSpec; 184 LayoutSize m_containerSize; 185 bool m_hasSetContainerSize; 178 186 }; 179 187 -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r98483 r98508 44 44 #include "ImageBuffer.h" 45 45 #include "ImageObserver.h" 46 #include "Length.h"47 46 #include "Page.h" 48 #include "RenderSVGRoot.h"49 47 #include "RenderView.h" 50 48 #include "ResourceError.h" … … 65 63 } 66 64 67 void setObserver(SVGImage* image) { m_image = image; }68 virtual bool isSVGImageChromeClient() const { return true; }69 65 SVGImage* image() const { return m_image; } 70 66 … … 104 100 } 105 101 106 void SVGImage::setContainerZoom(float containerZoom)107 {108 if (!m_page)109 return;110 m_chromeClient->setObserver(0);111 m_page->mainFrame()->setPageZoomFactor(containerZoom);112 m_chromeClient->setObserver(this);113 }114 115 102 void SVGImage::setContainerSize(const IntSize& containerSize) 116 103 { 117 ASSERT(!containerSize.isEmpty()); 118 104 if (containerSize.isEmpty()) 105 return; 106 119 107 if (!m_page) 120 108 return; … … 124 112 return; 125 113 126 RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer()); 127 if (!renderer) 128 return; 129 renderer->setContainerSize(containerSize); 130 131 frame->view()->resize(size()); 132 if (frame->view()->needsLayout()) 133 frame->view()->layout(); 114 rootElement->setContainerSize(containerSize); 134 115 } 135 116 … … 142 123 if (!rootElement) 143 124 return false; 144 if (RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer())) 145 return !renderer->containerSize().isEmpty(); 146 return false; 125 126 return rootElement->hasSetContainerSize(); 147 127 } 148 128 … … 155 135 if (!rootElement) 156 136 return IntSize(); 157 158 RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer()); 159 if (!renderer) 160 return IntSize(); 161 162 // If a container size is available it has precedence. 163 IntSize containerSize = renderer->containerSize(); 164 if (!containerSize.isEmpty()) 165 return containerSize; 166 167 // Otherwise fallback to the viewBox size. 168 IntSize size = enclosingIntRect(rootElement->currentViewBoxRect()).size(); 169 if (!size.isEmpty()) 170 return size; 171 172 // As last resort, use CSS default intrinsic size. 173 return IntSize(300, 150); 137 138 SVGLength width = rootElement->width(); 139 SVGLength height = rootElement->height(); 140 141 IntSize svgSize; 142 if (width.unitType() == LengthTypePercentage) 143 svgSize.setWidth(rootElement->relativeWidthValue()); 144 else 145 svgSize.setWidth(static_cast<int>(width.value(rootElement))); 146 147 if (height.unitType() == LengthTypePercentage) 148 svgSize.setHeight(rootElement->relativeHeightValue()); 149 else 150 svgSize.setHeight(static_cast<int>(height.value(rootElement))); 151 152 return svgSize; 153 } 154 155 bool SVGImage::hasRelativeWidth() const 156 { 157 if (!m_page) 158 return false; 159 SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_page->mainFrame()->document())->rootElement(); 160 if (!rootElement) 161 return false; 162 163 return rootElement->width().unitType() == LengthTypePercentage; 164 } 165 166 bool SVGImage::hasRelativeHeight() const 167 { 168 if (!m_page) 169 return false; 170 SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_page->mainFrame()->document())->rootElement(); 171 if (!rootElement) 172 return false; 173 174 return rootElement->height().unitType() == LengthTypePercentage; 174 175 } 175 176 … … 197 198 context->scale(scale); 198 199 200 view->resize(size()); 201 202 if (view->needsLayout()) 203 view->layout(); 204 199 205 view->paint(context, IntRect(0, 0, view->width(), view->height())); 200 206 … … 208 214 } 209 215 210 RenderBox* SVGImage::embeddedContentBox() const 211 { 212 if (!m_page) 213 return 0;216 void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) 217 { 218 if (!m_page) 219 return; 214 220 Frame* frame = m_page->mainFrame(); 215 221 SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement(); 216 222 if (!rootElement) 217 return 0;218 return toRenderBox(rootElement->renderer());219 }220 221 void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)222 {223 if (!m_page)224 return;225 Frame* frame = m_page->mainFrame();226 SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement();227 if (!rootElement)228 223 return; 229 224 RenderBox* renderer = toRenderBox(rootElement->renderer()); … … 233 228 intrinsicWidth = renderer->style()->width(); 234 229 intrinsicHeight = renderer->style()->height(); 235 if (rootElement->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)236 intrinsicRatio = rootElement->currentViewBoxRect().size();230 // FIXME: Add intrinsicRatio calculation from webkit.org/b/47156. 231 intrinsicRatio = FloatSize(); 237 232 } 238 233 … … 301 296 FrameLoader* loader = frame->loader(); 302 297 loader->setForcedSandboxFlags(SandboxAll); 303 304 frame->view()->setCanHaveScrollbars(false); // SVG Images will always synthesize a viewBox, if it's not available, and thus never see scrollbars.305 frame->view()->setTransparent(true); // SVG Images are transparent.306 307 298 ASSERT(loader->activeDocumentLoader()); // DocumentLoader should have been created by frame->init(). 308 299 loader->activeDocumentLoader()->writer()->setMIMEType("image/svg+xml"); … … 310 301 loader->activeDocumentLoader()->writer()->addData(data()->data(), data()->size()); 311 302 loader->activeDocumentLoader()->writer()->end(); 312 313 frame->view()->resize(size()); 314 315 if (frame->view()->needsLayout()) 316 frame->view()->layout(); 303 frame->view()->setTransparent(true); // SVG Images are transparent. 317 304 } 318 305 -
trunk/Source/WebCore/svg/graphics/SVGImage.h
r98483 r98508 36 36 37 37 class Page; 38 class RenderBox;39 38 class SVGImageChromeClient; 40 39 … … 45 44 return adoptRef(new SVGImage(observer)); 46 45 } 47 48 RenderBox* embeddedContentBox() const;49 void setContainerZoom(float);50 46 51 47 virtual bool isSVGImage() const { return true; } … … 58 54 virtual void setContainerSize(const IntSize&); 59 55 virtual bool usesContainerSize() const; 56 virtual bool hasRelativeWidth() const; 57 virtual bool hasRelativeHeight() const; 60 58 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio); 61 59
Note: See TracChangeset
for help on using the changeset viewer.