Changeset 169407 in webkit
- Timestamp:
- May 27, 2014, 6:33:26 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 2 deleted
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r169406 r169407 1 2014-05-27 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 vw/vh units used as font/line-height values don't scale with the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=87846 5 6 Reviewed by Darin Adler. 7 8 Update existing tests to work with the proper behavior of viewport 9 units. 10 11 Add tests for some of the things fixed by this patch: handling of 12 viewport units in font sizes, with calc, and when the viewport is 13 resized without a reload. 14 15 The anonymous block and percent size child tests make sure that the 16 viewport unit updates still work properly when there is another 17 relative unit the depends on the size specified in viewport units. 18 19 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt: 20 * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: 21 * css3/viewport-percentage-lengths/resources/resize-test.js: Added. 22 (resizeTest): 23 (standardResizeTest): 24 * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Added. 25 * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Added. 26 * css3/viewport-percentage-lengths/viewport-percentage-lengths-calc-expected.txt: Added. 27 * css3/viewport-percentage-lengths/viewport-percentage-lengths-calc.html: Added. 28 * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Added. 29 * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Added. 30 * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Added. 31 * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Added. 32 * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Added. 33 * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added. 34 * fast/canvas/draw-focus-if-needed-expected.txt: Removed. 35 * fast/canvas/draw-focus-if-needed.html: Removed. 36 * fast/masking/parsing-clip-path-shape-expected.txt: 37 * fast/masking/parsing-clip-path-shape.html: 38 * fast/shapes/parsing/parsing-shape-lengths-expected.txt: 39 * fast/shapes/parsing/parsing-shape-lengths.html: 40 1 41 2014-05-27 Zoltan Horvath <zoltan@webkit.org> 2 42 -
trunk/LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt
r142021 r169407 9 9 PASS style.getPropertyValue("font-size") is '24px' 10 10 PASS style.getPropertyValue("line-height") is '32px' 11 PASS style.getPropertyValue("text-indent") is ' 2vw'11 PASS style.getPropertyValue("text-indent") is '16px' 12 12 PASS style.getPropertyValue("margin-left") is '16px' 13 13 PASS style.getPropertyValue("margin-right") is '16px' … … 18 18 PASS style.getPropertyValue("border-bottom-left-radius") is '8px' 19 19 PASS style.getPropertyValue("border-bottom-right-radius") is '8px' 20 PASS style.getPropertyValue("min-height") is ' 10vw'21 PASS style.getPropertyValue("min-width") is ' 10vw'22 PASS style.getPropertyValue("max-height") is ' 60vw'23 PASS style.getPropertyValue("max-width") is ' 60vw'20 PASS style.getPropertyValue("min-height") is '80px' 21 PASS style.getPropertyValue("min-width") is '80px' 22 PASS style.getPropertyValue("max-height") is '480px' 23 PASS style.getPropertyValue("max-width") is '480px' 24 24 PASS style.getPropertyValue("top") is '80px' 25 25 PASS style.getPropertyValue("bottom") is '80px' … … 36 36 PASS style.getPropertyValue("font-size") is '18px' 37 37 PASS style.getPropertyValue("line-height") is '24px' 38 PASS style.getPropertyValue("text-indent") is ' 2vh'38 PASS style.getPropertyValue("text-indent") is '12px' 39 39 PASS style.getPropertyValue("margin-left") is '12px' 40 40 PASS style.getPropertyValue("margin-right") is '12px' … … 45 45 PASS style.getPropertyValue("border-bottom-left-radius") is '6px' 46 46 PASS style.getPropertyValue("border-bottom-right-radius") is '6px' 47 PASS style.getPropertyValue("min-height") is ' 10vh'48 PASS style.getPropertyValue("min-width") is ' 10vh'49 PASS style.getPropertyValue("max-height") is ' 60vh'50 PASS style.getPropertyValue("max-width") is ' 60vh'47 PASS style.getPropertyValue("min-height") is '60px' 48 PASS style.getPropertyValue("min-width") is '60px' 49 PASS style.getPropertyValue("max-height") is '360px' 50 PASS style.getPropertyValue("max-width") is '360px' 51 51 PASS style.getPropertyValue("top") is '60px' 52 52 PASS style.getPropertyValue("bottom") is '60px' … … 63 63 PASS style.getPropertyValue("font-size") is '18px' 64 64 PASS style.getPropertyValue("line-height") is '24px' 65 PASS style.getPropertyValue("text-indent") is ' 2vmin'65 PASS style.getPropertyValue("text-indent") is '12px' 66 66 PASS style.getPropertyValue("margin-left") is '12px' 67 67 PASS style.getPropertyValue("margin-right") is '12px' … … 72 72 PASS style.getPropertyValue("border-bottom-left-radius") is '6px' 73 73 PASS style.getPropertyValue("border-bottom-right-radius") is '6px' 74 PASS style.getPropertyValue("min-height") is ' 10vmin'75 PASS style.getPropertyValue("min-width") is ' 10vmin'76 PASS style.getPropertyValue("max-height") is ' 60vmin'77 PASS style.getPropertyValue("max-width") is ' 60vmin'74 PASS style.getPropertyValue("min-height") is '60px' 75 PASS style.getPropertyValue("min-width") is '60px' 76 PASS style.getPropertyValue("max-height") is '360px' 77 PASS style.getPropertyValue("max-width") is '360px' 78 78 PASS style.getPropertyValue("top") is '60px' 79 79 PASS style.getPropertyValue("bottom") is '60px' … … 90 90 PASS style.getPropertyValue("font-size") is '24px' 91 91 PASS style.getPropertyValue("line-height") is '32px' 92 PASS style.getPropertyValue("text-indent") is ' 2vmax'92 PASS style.getPropertyValue("text-indent") is '16px' 93 93 PASS style.getPropertyValue("margin-left") is '16px' 94 94 PASS style.getPropertyValue("margin-right") is '16px' … … 99 99 PASS style.getPropertyValue("border-bottom-left-radius") is '8px' 100 100 PASS style.getPropertyValue("border-bottom-right-radius") is '8px' 101 PASS style.getPropertyValue("min-height") is ' 10vmax'102 PASS style.getPropertyValue("min-width") is ' 10vmax'103 PASS style.getPropertyValue("max-height") is ' 60vmax'104 PASS style.getPropertyValue("max-width") is ' 60vmax'101 PASS style.getPropertyValue("min-height") is '80px' 102 PASS style.getPropertyValue("min-width") is '80px' 103 PASS style.getPropertyValue("max-height") is '480px' 104 PASS style.getPropertyValue("max-width") is '480px' 105 105 PASS style.getPropertyValue("top") is '80px' 106 106 PASS style.getPropertyValue("bottom") is '80px' -
trunk/LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html
r155275 r169407 150 150 var element, style; 151 151 152 function vw(x) { 153 return "'" + Math.floor(x * window.innerWidth / 100) + "px'"; 154 } 155 156 function vh(x) { 157 return "'" + Math.floor(x * window.innerHeight / 100) + "px'"; 158 } 159 160 function vmin(x) { 161 return "'" + Math.floor(x * Math.min(window.innerWidth, window.innerHeight) / 100) + "px'"; 162 } 163 164 function vmax(x) { 165 return "'" + Math.floor(x * Math.max(window.innerWidth, window.innerHeight) / 100) + "px'"; 166 } 167 152 168 function getTheStyle() { 153 169 debug("Test for vw") … … 155 171 style = window.getComputedStyle(element,null); 156 172 var viewportWidth = window.innerWidth; 157 shouldBe('style.getPropertyValue("height")', "'" + Math.floor(30 * viewportWidth / 100) + "px'");158 shouldBe('style.getPropertyValue("width")', "'" + Math.floor(30 * viewportWidth / 100) + "px'");159 shouldBe('style.getPropertyValue("font-size")', "'" + Math.floor(3 * viewportWidth / 100) + "px'");160 shouldBe('style.getPropertyValue("line-height")', "'" + Math.floor(4 * viewportWidth / 100) + "px'");161 shouldBe('style.getPropertyValue("text-indent")', "'2vw'");162 shouldBe('style.getPropertyValue("margin-left")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");163 shouldBe('style.getPropertyValue("margin-right")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");164 shouldBe('style.getPropertyValue("margin-top")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");165 shouldBe('style.getPropertyValue("margin-bottom")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");166 shouldBe('style.getPropertyValue("border-top-left-radius")', "'" + Math.floor(1 * viewportWidth / 100) + "px'");167 shouldBe('style.getPropertyValue("border-top-right-radius")', "'" + Math.floor(1 * viewportWidth / 100) + "px'");168 shouldBe('style.getPropertyValue("border-bottom-left-radius")', "'" + Math.floor(1 * viewportWidth / 100) + "px'");169 shouldBe('style.getPropertyValue("border-bottom-right-radius")', "'" + Math.floor(1 * viewportWidth / 100) + "px'");170 shouldBe('style.getPropertyValue("min-height")', "'10vw'");171 shouldBe('style.getPropertyValue("min-width")', "'10vw'");172 shouldBe('style.getPropertyValue("max-height")', "'60vw'");173 shouldBe('style.getPropertyValue("max-width")', "'60vw'");173 shouldBe('style.getPropertyValue("height")', vw(30)); 174 shouldBe('style.getPropertyValue("width")', vw(30)); 175 shouldBe('style.getPropertyValue("font-size")', vw(3)); 176 shouldBe('style.getPropertyValue("line-height")', vw(4)); 177 shouldBe('style.getPropertyValue("text-indent")', vw(2)); 178 shouldBe('style.getPropertyValue("margin-left")', vw(2)); 179 shouldBe('style.getPropertyValue("margin-right")', vw(2)); 180 shouldBe('style.getPropertyValue("margin-top")', vw(2)); 181 shouldBe('style.getPropertyValue("margin-bottom")', vw(2)); 182 shouldBe('style.getPropertyValue("border-top-left-radius")', vw(1)); 183 shouldBe('style.getPropertyValue("border-top-right-radius")', vw(1)); 184 shouldBe('style.getPropertyValue("border-bottom-left-radius")', vw(1)); 185 shouldBe('style.getPropertyValue("border-bottom-right-radius")', vw(1)); 186 shouldBe('style.getPropertyValue("min-height")', vw(10)); 187 shouldBe('style.getPropertyValue("min-width")', vw(10)); 188 shouldBe('style.getPropertyValue("max-height")', vw(60)); 189 shouldBe('style.getPropertyValue("max-width")', vw(60)); 174 190 element.id = "element-container-absolute-vw"; 175 shouldBe('style.getPropertyValue("top")', "'" + Math.floor(10 * viewportWidth / 100) + "px'");176 shouldBe('style.getPropertyValue("bottom")', "'" + Math.floor(10 * viewportWidth / 100) + "px'");177 shouldBe('style.getPropertyValue("left")', "'" + Math.floor(10 * viewportWidth / 100) + "px'");178 shouldBe('style.getPropertyValue("right")', "'" + Math.floor(10 * viewportWidth / 100) + "px'");179 shouldBe('style.getPropertyValue("padding-left")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");180 shouldBe('style.getPropertyValue("padding-right")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");181 shouldBe('style.getPropertyValue("padding-top")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");182 shouldBe('style.getPropertyValue("padding-bottom")', "'" + Math.floor(2 * viewportWidth / 100) + "px'");191 shouldBe('style.getPropertyValue("top")', vw(10)); 192 shouldBe('style.getPropertyValue("bottom")', vw(10)); 193 shouldBe('style.getPropertyValue("left")', vw(10)); 194 shouldBe('style.getPropertyValue("right")', vw(10)); 195 shouldBe('style.getPropertyValue("padding-left")', vw(2)); 196 shouldBe('style.getPropertyValue("padding-right")', vw(2)); 197 shouldBe('style.getPropertyValue("padding-top")', vw(2)); 198 shouldBe('style.getPropertyValue("padding-bottom")', vw(2)); 183 199 184 200 debug("\nTest for vh") … … 186 202 style = window.getComputedStyle(element,null); 187 203 var viewportHeight = window.innerHeight; 188 shouldBe('style.getPropertyValue("height")', "'" + Math.floor(30 * viewportHeight / 100) + "px'");189 shouldBe('style.getPropertyValue("width")', "'" + Math.floor(30 * viewportHeight / 100) + "px'");190 shouldBe('style.getPropertyValue("font-size")', "'" + Math.floor(3 * viewportHeight / 100) + "px'");191 shouldBe('style.getPropertyValue("line-height")', "'" + Math.floor(4 * viewportHeight / 100) + "px'");192 shouldBe('style.getPropertyValue("text-indent")', "'2vh'");193 shouldBe('style.getPropertyValue("margin-left")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");194 shouldBe('style.getPropertyValue("margin-right")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");195 shouldBe('style.getPropertyValue("margin-top")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");196 shouldBe('style.getPropertyValue("margin-bottom")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");197 shouldBe('style.getPropertyValue("border-top-left-radius")', "'" + Math.floor(1 * viewportHeight / 100) + "px'");198 shouldBe('style.getPropertyValue("border-top-right-radius")', "'" + Math.floor(1 * viewportHeight / 100) + "px'");199 shouldBe('style.getPropertyValue("border-bottom-left-radius")', "'" + Math.floor(1 * viewportHeight / 100) + "px'");200 shouldBe('style.getPropertyValue("border-bottom-right-radius")', "'" + Math.floor(1 * viewportHeight / 100) + "px'");201 shouldBe('style.getPropertyValue("min-height")', "'10vh'");202 shouldBe('style.getPropertyValue("min-width")', "'10vh'");203 shouldBe('style.getPropertyValue("max-height")', "'60vh'");204 shouldBe('style.getPropertyValue("max-width")', "'60vh'");204 shouldBe('style.getPropertyValue("height")', vh(30)); 205 shouldBe('style.getPropertyValue("width")', vh(30)); 206 shouldBe('style.getPropertyValue("font-size")', vh(3)); 207 shouldBe('style.getPropertyValue("line-height")', vh(4)); 208 shouldBe('style.getPropertyValue("text-indent")', vh(2)); 209 shouldBe('style.getPropertyValue("margin-left")', vh(2)); 210 shouldBe('style.getPropertyValue("margin-right")', vh(2)); 211 shouldBe('style.getPropertyValue("margin-top")', vh(2)); 212 shouldBe('style.getPropertyValue("margin-bottom")', vh(2)); 213 shouldBe('style.getPropertyValue("border-top-left-radius")', vh(1)); 214 shouldBe('style.getPropertyValue("border-top-right-radius")', vh(1)); 215 shouldBe('style.getPropertyValue("border-bottom-left-radius")', vh(1)); 216 shouldBe('style.getPropertyValue("border-bottom-right-radius")', vh(1)); 217 shouldBe('style.getPropertyValue("min-height")', vh(10)); 218 shouldBe('style.getPropertyValue("min-width")', vh(10)); 219 shouldBe('style.getPropertyValue("max-height")', vh(60)); 220 shouldBe('style.getPropertyValue("max-width")', vh(60)); 205 221 element.id = "element-container-absolute-vh"; 206 shouldBe('style.getPropertyValue("top")', "'" + Math.floor(10 * viewportHeight / 100) + "px'");207 shouldBe('style.getPropertyValue("bottom")', "'" + Math.floor(10 * viewportHeight / 100) + "px'");208 shouldBe('style.getPropertyValue("left")', "'" + Math.floor(10 * viewportHeight / 100) + "px'");209 shouldBe('style.getPropertyValue("right")', "'" + Math.floor(10 * viewportHeight / 100) + "px'");210 shouldBe('style.getPropertyValue("padding-left")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");211 shouldBe('style.getPropertyValue("padding-right")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");212 shouldBe('style.getPropertyValue("padding-top")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");213 shouldBe('style.getPropertyValue("padding-bottom")', "'" + Math.floor(2 * viewportHeight / 100) + "px'");222 shouldBe('style.getPropertyValue("top")', vh(10)); 223 shouldBe('style.getPropertyValue("bottom")', vh(10)); 224 shouldBe('style.getPropertyValue("left")', vh(10)); 225 shouldBe('style.getPropertyValue("right")', vh(10)); 226 shouldBe('style.getPropertyValue("padding-left")', vh(2)); 227 shouldBe('style.getPropertyValue("padding-right")', vh(2)); 228 shouldBe('style.getPropertyValue("padding-top")', vh(2)); 229 shouldBe('style.getPropertyValue("padding-bottom")', vh(2)); 214 230 215 231 debug("\nTest for vmin") … … 217 233 style = window.getComputedStyle(element,null); 218 234 var viewportMinLength = Math.min(window.innerWidth, window.innerHeight); 219 shouldBe('style.getPropertyValue("height")', "'" + Math.floor(30 * viewportMinLength / 100) + "px'");220 shouldBe('style.getPropertyValue("width")', "'" + Math.floor(30 * viewportMinLength / 100) + "px'");221 shouldBe('style.getPropertyValue("font-size")', "'" + Math.floor(3 * viewportMinLength / 100) + "px'");222 shouldBe('style.getPropertyValue("line-height")', "'" + Math.floor(4 * viewportMinLength / 100) + "px'");223 shouldBe('style.getPropertyValue("text-indent")', "'2vmin'");224 shouldBe('style.getPropertyValue("margin-left")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");225 shouldBe('style.getPropertyValue("margin-right")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");226 shouldBe('style.getPropertyValue("margin-top")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");227 shouldBe('style.getPropertyValue("margin-bottom")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");228 shouldBe('style.getPropertyValue("border-top-left-radius")', "'" + Math.floor(1 * viewportMinLength / 100) + "px'");229 shouldBe('style.getPropertyValue("border-top-right-radius")', "'" + Math.floor(1 * viewportMinLength / 100) + "px'");230 shouldBe('style.getPropertyValue("border-bottom-left-radius")', "'" + Math.floor(1 * viewportMinLength / 100) + "px'");231 shouldBe('style.getPropertyValue("border-bottom-right-radius")', "'" + Math.floor(1 * viewportMinLength / 100) + "px'");232 shouldBe('style.getPropertyValue("min-height")', "'10vmin'");233 shouldBe('style.getPropertyValue("min-width")', "'10vmin'");234 shouldBe('style.getPropertyValue("max-height")', "'60vmin'");235 shouldBe('style.getPropertyValue("max-width")', "'60vmin'");235 shouldBe('style.getPropertyValue("height")', vmin(30)); 236 shouldBe('style.getPropertyValue("width")', vmin(30)); 237 shouldBe('style.getPropertyValue("font-size")', vmin(3)); 238 shouldBe('style.getPropertyValue("line-height")', vmin(4)); 239 shouldBe('style.getPropertyValue("text-indent")', vmin(2)); 240 shouldBe('style.getPropertyValue("margin-left")', vmin(2)); 241 shouldBe('style.getPropertyValue("margin-right")', vmin(2)); 242 shouldBe('style.getPropertyValue("margin-top")', vmin(2)); 243 shouldBe('style.getPropertyValue("margin-bottom")', vmin(2)); 244 shouldBe('style.getPropertyValue("border-top-left-radius")', vmin(1)); 245 shouldBe('style.getPropertyValue("border-top-right-radius")', vmin(1)); 246 shouldBe('style.getPropertyValue("border-bottom-left-radius")', vmin(1)); 247 shouldBe('style.getPropertyValue("border-bottom-right-radius")', vmin(1)); 248 shouldBe('style.getPropertyValue("min-height")', vmin(10)); 249 shouldBe('style.getPropertyValue("min-width")', vmin(10)); 250 shouldBe('style.getPropertyValue("max-height")', vmin(60)); 251 shouldBe('style.getPropertyValue("max-width")', vmin(60)); 236 252 element.id = "element-container-absolute-vmin"; 237 shouldBe('style.getPropertyValue("top")', "'" + Math.floor(10 * viewportMinLength / 100) + "px'");238 shouldBe('style.getPropertyValue("bottom")', "'" + Math.floor(10 * viewportMinLength / 100) + "px'");239 shouldBe('style.getPropertyValue("left")', "'" + Math.floor(10 * viewportMinLength / 100) + "px'");240 shouldBe('style.getPropertyValue("right")', "'" + Math.floor(10 * viewportMinLength / 100) + "px'");241 shouldBe('style.getPropertyValue("padding-left")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");242 shouldBe('style.getPropertyValue("padding-right")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");243 shouldBe('style.getPropertyValue("padding-top")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");244 shouldBe('style.getPropertyValue("padding-bottom")', "'" + Math.floor(2 * viewportMinLength / 100) + "px'");253 shouldBe('style.getPropertyValue("top")', vmin(10)); 254 shouldBe('style.getPropertyValue("bottom")', vmin(10)); 255 shouldBe('style.getPropertyValue("left")', vmin(10)); 256 shouldBe('style.getPropertyValue("right")', vmin(10)); 257 shouldBe('style.getPropertyValue("padding-left")', vmin(2)); 258 shouldBe('style.getPropertyValue("padding-right")', vmin(2)); 259 shouldBe('style.getPropertyValue("padding-top")', vmin(2)); 260 shouldBe('style.getPropertyValue("padding-bottom")', vmin(2)); 245 261 246 262 debug("\nTest for vmax") … … 248 264 style = window.getComputedStyle(element,null); 249 265 var viewportMaxLength = Math.max(window.innerWidth, window.innerHeight); 250 shouldBe('style.getPropertyValue("height")', "'" + Math.floor(30 * viewportMaxLength / 100) + "px'");251 shouldBe('style.getPropertyValue("width")', "'" + Math.floor(30 * viewportMaxLength / 100) + "px'");252 shouldBe('style.getPropertyValue("font-size")', "'" + Math.floor(3 * viewportMaxLength / 100) + "px'");253 shouldBe('style.getPropertyValue("line-height")', "'" + Math.floor(4 * viewportMaxLength / 100) + "px'");254 shouldBe('style.getPropertyValue("text-indent")', "'2vmax'");255 shouldBe('style.getPropertyValue("margin-left")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");256 shouldBe('style.getPropertyValue("margin-right")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");257 shouldBe('style.getPropertyValue("margin-top")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");258 shouldBe('style.getPropertyValue("margin-bottom")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");259 shouldBe('style.getPropertyValue("border-top-left-radius")', "'" + Math.floor(1 * viewportMaxLength / 100) + "px'");260 shouldBe('style.getPropertyValue("border-top-right-radius")', "'" + Math.floor(1 * viewportMaxLength / 100) + "px'");261 shouldBe('style.getPropertyValue("border-bottom-left-radius")', "'" + Math.floor(1 * viewportMaxLength / 100) + "px'");262 shouldBe('style.getPropertyValue("border-bottom-right-radius")', "'" + Math.floor(1 * viewportMaxLength / 100) + "px'");263 shouldBe('style.getPropertyValue("min-height")', "'10vmax'");264 shouldBe('style.getPropertyValue("min-width")', "'10vmax'");265 shouldBe('style.getPropertyValue("max-height")', "'60vmax'");266 shouldBe('style.getPropertyValue("max-width")', "'60vmax'");266 shouldBe('style.getPropertyValue("height")', vmax(30)); 267 shouldBe('style.getPropertyValue("width")', vmax(30)); 268 shouldBe('style.getPropertyValue("font-size")', vmax(3)); 269 shouldBe('style.getPropertyValue("line-height")', vmax(4)); 270 shouldBe('style.getPropertyValue("text-indent")', vmax(2)); 271 shouldBe('style.getPropertyValue("margin-left")', vmax(2)); 272 shouldBe('style.getPropertyValue("margin-right")', vmax(2)); 273 shouldBe('style.getPropertyValue("margin-top")', vmax(2)); 274 shouldBe('style.getPropertyValue("margin-bottom")', vmax(2)); 275 shouldBe('style.getPropertyValue("border-top-left-radius")', vmax(1)); 276 shouldBe('style.getPropertyValue("border-top-right-radius")', vmax(1)); 277 shouldBe('style.getPropertyValue("border-bottom-left-radius")', vmax(1)); 278 shouldBe('style.getPropertyValue("border-bottom-right-radius")', vmax(1)); 279 shouldBe('style.getPropertyValue("min-height")', vmax(10)); 280 shouldBe('style.getPropertyValue("min-width")', vmax(10)); 281 shouldBe('style.getPropertyValue("max-height")', vmax(60)); 282 shouldBe('style.getPropertyValue("max-width")', vmax(60)); 267 283 element.id = "element-container-absolute-vmax"; 268 shouldBe('style.getPropertyValue("top")', "'" + Math.floor(10 * viewportMaxLength / 100) + "px'");269 shouldBe('style.getPropertyValue("bottom")', "'" + Math.floor(10 * viewportMaxLength / 100) + "px'");270 shouldBe('style.getPropertyValue("left")', "'" + Math.floor(10 * viewportMaxLength / 100) + "px'");271 shouldBe('style.getPropertyValue("right")', "'" + Math.floor(10 * viewportMaxLength / 100) + "px'");272 shouldBe('style.getPropertyValue("padding-left")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");273 shouldBe('style.getPropertyValue("padding-right")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");274 shouldBe('style.getPropertyValue("padding-top")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");275 shouldBe('style.getPropertyValue("padding-bottom")', "'" + Math.floor(2 * viewportMaxLength / 100) + "px'");284 shouldBe('style.getPropertyValue("top")', vmax(10)); 285 shouldBe('style.getPropertyValue("bottom")', vmax(10)); 286 shouldBe('style.getPropertyValue("left")', vmax(10)); 287 shouldBe('style.getPropertyValue("right")', vmax(10)); 288 shouldBe('style.getPropertyValue("padding-left")', vmax(2)); 289 shouldBe('style.getPropertyValue("padding-right")', vmax(2)); 290 shouldBe('style.getPropertyValue("padding-top")', vmax(2)); 291 shouldBe('style.getPropertyValue("padding-bottom")', vmax(2)); 276 292 } 277 293 getTheStyle(); -
trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt
r167132 r169407 18 18 PASS innerStyle("-webkit-clip-path", "circle(1vh at 1vh 1vh)") is "circle(1vh at 1vh 1vh)" 19 19 PASS innerStyle("-webkit-clip-path", "circle(1vmin at 1vmin 1vmin)") is "circle(1vmin at 1vmin 1vmin)" 20 PASS computedStyle("-webkit-clip-path", "circle(1.5vw at .5vw 1vw)") is "circle(1 .5vw at 0.5vw 1vw)"21 PASS computedStyle("-webkit-clip-path", "circle(1.5vh at .5vh 1vh)") is "circle( 1.5vh at 0.5vh 1vh)"22 PASS computedStyle("-webkit-clip-path", "circle(1.5vmin at .5vmin 1vmin)") is "circle( 1.5vmin at 0.5vmin 1vmin)"20 PASS computedStyle("-webkit-clip-path", "circle(1.5vw at .5vw 1vw)") is "circle(12px at 4px 8px)" 21 PASS computedStyle("-webkit-clip-path", "circle(1.5vh at .5vh 1vh)") is "circle(9px at 3px 6px)" 22 PASS computedStyle("-webkit-clip-path", "circle(1.5vmin at .5vmin 1vmin)") is "circle(9px at 3px 6px)" 23 23 PASS computedStyle("-webkit-clip-path", "circle(150% at 50% 100%)") is "circle(150% at 50% 100%)" 24 24 PASS computedStyle("-webkit-clip-path", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10%)" -
trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html
r167132 r169407 64 64 testInner("-webkit-clip-path", "circle(1vmin at 1vmin 1vmin)", "circle(1vmin at 1vmin 1vmin)"); 65 65 66 testComputed("-webkit-clip-path", "circle(1.5vw at .5vw 1vw)", "circle(1 .5vw at 0.5vw 1vw)");67 testComputed("-webkit-clip-path", "circle(1.5vh at .5vh 1vh)", "circle( 1.5vh at 0.5vh 1vh)");68 testComputed("-webkit-clip-path", "circle(1.5vmin at .5vmin 1vmin)", "circle( 1.5vmin at 0.5vmin 1vmin)");66 testComputed("-webkit-clip-path", "circle(1.5vw at .5vw 1vw)", "circle(12px at 4px 8px)"); 67 testComputed("-webkit-clip-path", "circle(1.5vh at .5vh 1vh)", "circle(9px at 3px 6px)"); 68 testComputed("-webkit-clip-path", "circle(1.5vmin at .5vmin 1vmin)", "circle(9px at 3px 6px)"); 69 69 70 70 // percentage lengths - units -
trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths-expected.txt
r167132 r169407 23 23 PASS getStyleValue("-webkit-shape-outside", "circle(1vh at 1vh 1vh)") is "circle(1vh at 1vh 1vh)" 24 24 PASS getStyleValue("-webkit-shape-outside", "circle(1vmin at 1vmin 1vmin)") is "circle(1vmin at 1vmin 1vmin)" 25 PASS getComputedStyleValue("-webkit-shape-outside", "circle(1.5vw at .5vw 1vw)") is "circle(1 .5vw at 0.5vw 1vw)"26 PASS getComputedStyleValue("-webkit-shape-outside", "circle(1.5vh at .5vh 1vh)") is "circle( 1.5vh at 0.5vh 1vh)"27 PASS getComputedStyleValue("-webkit-shape-outside", "circle(1.5vmin at .5vmin 1vmin)") is "circle( 1.5vmin at 0.5vmin 1vmin)"25 PASS getComputedStyleValue("-webkit-shape-outside", "circle(1.5vw at .5vw 1vw)") is "circle(12px at 4px 8px)" 26 PASS getComputedStyleValue("-webkit-shape-outside", "circle(1.5vh at .5vh 1vh)") is "circle(9px at 3px 6px)" 27 PASS getComputedStyleValue("-webkit-shape-outside", "circle(1.5vmin at .5vmin 1vmin)") is "circle(9px at 3px 6px)" 28 28 PASS getStyleValue("-webkit-shape-outside", "circle(100% at 100% 100%)") is "circle(100% at 100% 100%)" 29 29 PASS getStyleValue("-webkit-shape-outside", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10%)" -
trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths.html
r167132 r169407 65 65 testStyleValue("circle(1vmin at 1vmin 1vmin)", "circle(1vmin at 1vmin 1vmin)"); 66 66 67 testComputedStyleValue("circle(1.5vw at .5vw 1vw)", "circle(1 .5vw at 0.5vw 1vw)");68 testComputedStyleValue("circle(1.5vh at .5vh 1vh)", "circle( 1.5vh at 0.5vh 1vh)");69 testComputedStyleValue("circle(1.5vmin at .5vmin 1vmin)", "circle( 1.5vmin at 0.5vmin 1vmin)");67 testComputedStyleValue("circle(1.5vw at .5vw 1vw)", "circle(12px at 4px 8px)"); 68 testComputedStyleValue("circle(1.5vh at .5vh 1vh)", "circle(9px at 3px 6px)"); 69 testComputedStyleValue("circle(1.5vmin at .5vmin 1vmin)", "circle(9px at 3px 6px)"); 70 70 71 71 // percentage lengths - units -
trunk/Source/WebCore/ChangeLog
r169406 r169407 1 2014-05-27 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 vw/vh units used as font/line-height values don't scale with the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=87846 5 6 Reviewed by Darin Adler. 7 8 This patch moves the resolution of viewport units to style recalc 9 time. Currently viewport units are left unresolved during style 10 recalcs, which leads to many problems with viewport units. Moving the 11 resolution will fix these problems, as well as reduce the plumbing 12 that goes on. 13 14 This patch touches a lot of files since the valueForLength functions 15 no longer need a RenderView. The interesting changes are in: 16 17 - CSSToLengthConversionData -> CSSPrimitiveValue: for moving 18 resolution to style recalc time. 19 - Length / LengthFunctions: no longer needs to know about viewport 20 units. 21 - FrameView -> Document -> StyleResolver: for scheduling style recalcs 22 upon resize 23 24 Note that getComputedStyle will now return pixel values when viewport 25 units are used. This behavior matches Firefox and the css3-cascade 26 spec. 27 28 This is based on a Blink patch by timloh@chromium.org. 29 30 Tests: css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html 31 css3/viewport-percentage-lengths/viewport-percentage-lengths-calc.html 32 css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html 33 css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html 34 css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html 35 36 * WebCore.exp.in: Remove RenderView argument to floatValueForLength. 37 * accessibility/atk/WebKitAccessibleInterfaceText.cpp: 38 (getAttributeSetForAccessibilityObject): Remove RenderView argument. 39 * css/BasicShapeFunctions.cpp: 40 (WebCore::convertToLength): Ditto. 41 (WebCore::floatValueForCenterCoordinate): Ditto. 42 * css/BasicShapeFunctions.h: Ditto. 43 * css/CSSCalculationValue.cpp: 44 (WebCore::unitCategory): Remove special handling for viewport units, 45 as they get resolved to pixels. 46 (WebCore::createCSS): Ditto. 47 * css/CSSComputedStyleDeclaration.cpp: 48 (WebCore::positionOffsetValue): Remove RendewView argument. 49 (WebCore::getBorderRadiusCornerValues): Remove handling of viewport 50 units, as they are already resolve to pixels here. 51 (WebCore::getBorderRadiusCornerValue): Remove RenderView argument. 52 (WebCore::getBorderRadiusShorthandValue): Ditto. 53 (WebCore::specifiedValueForGridTrackBreadth): Remove handling of 54 viewport units, as they are already resolved to pixels here. 55 (WebCore::specifiedValueForGridTrackSize): Remove RenderView argument. 56 (WebCore::valueForGridTrackList): Ditto. 57 (WebCore::lineHeightFromStyle): Ditto. 58 (WebCore::ComputedStyleExtractor::propertyValue): Ditto. 59 * css/CSSGradientValue.cpp: 60 (WebCore::CSSLinearGradientValue::createGradient): Pass RenderView to 61 CSSToLengthConversionData constructor. 62 (WebCore::CSSRadialGradientValue::createGradient): Ditto. 63 * css/CSSPrimitiveValue.cpp: 64 (WebCore::CSSPrimitiveValue::unitCategory): Remove handling of 65 viewport units, as they get resolved to pixels. 66 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Ditto. 67 (WebCore::CSSPrimitiveValue::init): Ditto. 68 (WebCore::CSSPrimitiveValue::computeLengthDouble): Resolve viewport 69 units to pixels. 70 (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory): Remove 71 handling of viewport units, since they get resolved to pixels. 72 (WebCore::CSSPrimitiveValue::viewportPercentageLength): Deleted. 73 * css/CSSPrimitiveValue.h: 74 (WebCore::CSSPrimitiveValue::isLength): Remove special handling of 75 viewport units, since they get resolved to pixels. 76 * css/CSSPrimitiveValueMappings.h: 77 (WebCore::CSSPrimitiveValue::convertToLength): Ditto. 78 * css/CSSToLengthConversionData.cpp: 79 (WebCore::CSSToLengthConversionData::viewportWidthFactor): Caclulate 80 conversion factor for viewport units to pixels. Note this does not 81 set hasViewportUnits on the RenderStyle if computing the font 82 size, because in the font size case, the RenderStyle is the 83 parent's style, not the current renderer's style. 84 (WebCore::CSSToLengthConversionData::viewportHeightFactor): Ditto. 85 (WebCore::CSSToLengthConversionData::viewportMinFactor): Ditto. 86 (WebCore::CSSToLengthConversionData::viewportMaxFactor): Ditto. 87 * css/CSSToLengthConversionData.h: 88 (WebCore::CSSToLengthConversionData::CSSToLengthConversionData): Add 89 RenderView parameter, and make RenderStyle non-const so that 90 hasViewportUnits can be set on the Style.. 91 (WebCore::CSSToLengthConversionData::style): style is now non-const. 92 (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom): Handle 93 RenderView argument. 94 * css/CSSToStyleMap.cpp: 95 (WebCore::CSSToStyleMap::mapFillXPosition): Remove handling of 96 viewport units, as they are already resolved to pixels here. 97 (WebCore::CSSToStyleMap::mapFillYPosition): Ditto. 98 * css/DeprecatedStyleBuilder.cpp: 99 (WebCore::ApplyPropertyLength::applyValue): Ditto. 100 (WebCore::ApplyPropertyBorderRadius::applyValue): Ditto. 101 (WebCore::ApplyPropertyComputeLength::applyValue): Ditto. 102 (WebCore::ApplyPropertyFontSize::applyValue): Ditto. 103 (WebCore::ApplyPropertyLineHeight::applyValue): Ditto. 104 (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue): Ditto. 105 (WebCore::ApplyPropertyWordSpacing::applyValue): Ditto. 106 (WebCore::ApplyPropertyVerticalAlign::applyValue): Ditto. 107 (WebCore::ApplyPropertyTextIndent::applyValue): Ditto. 108 * css/LengthFunctions.cpp: 109 (WebCore::minimumIntValueForLength): Remove RenderView argument. 110 (WebCore::intValueForLength): Remove RenderView argument and 111 roundPecentages. 112 (WebCore::minimumValueForLength): Remove RenderView argument, and 113 special handling of viewport units. 114 (WebCore::valueForLength): Ditto. 115 (WebCore::floatValueForLength): Ditto. 116 (WebCore::floatSizeForLengthSize): Remove RenderView argument. 117 * css/LengthFunctions.h: Ditto. 118 * css/MediaQueryEvaluator.cpp: 119 (WebCore::MediaQueryEvaluator::eval): Add RenderView argument for 120 CSSToLengthConversionData constuctor. 121 * css/StyleResolver.cpp: 122 (WebCore::StyleResolver::State::clear): Change to 0 arg constructor 123 for CSSToLengthConversionData. 124 (WebCore::StyleResolver::State::updateConversionData): In order to get 125 the RenderView, we need to have a valid Element set on the state. 126 Since this means that we need to set the conversion data in more 127 places, move the contruction of conversion data into this helper 128 method. 129 (WebCore::StyleResolver::State::initElement): Make sure conversion 130 data is up to date. 131 (WebCore::StyleResolver::State::initForStyleResolve): Ditto. 132 (WebCore::StyleResolver::State::setStyle): When the style is set, we 133 need to make sure to update the conversion data. 134 (WebCore::StyleResolver::styleForElement): If the style has viewport 135 units, flage the document so that we can make sure to recalc the 136 viewport unit values when the viewport is resized. 137 (WebCore::StyleResolver::pseudoStyleForElement): Ditto. 138 (WebCore::StyleResolver::updateFont): Make sure the font having 139 viewport units updates the style. 140 (WebCore::StyleResolver::convertToIntLength): Remove handling of 141 viewport units, as they are resolved to pixels. 142 (WebCore::StyleResolver::convertToFloatLength): Ditto. 143 (WebCore::StyleResolver::clearCachedPropertiesAffectedByViewportUnits): 144 Invalidate the matched properties cache for styles with viewport 145 units when the viewport is resized. 146 (WebCore::createGridTrackBreadth): Remove handling of viewport units, 147 as they are resolved to pixels. 148 (WebCore::StyleResolver::applyProperty): Ditto. 149 (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange): 150 Rename to be less confusing, since it has nothing to do with 151 viewport units. 152 (WebCore::StyleResolver::createFilterOperations): Remove handling of 153 viewport units, as they are resolved to pixels. 154 (WebCore::StyleResolver::affectedByViewportChange): Deleted. 155 (WebCore::StyleResolver::viewportPercentageValue): Deleted. 156 * css/StyleResolver.h: 157 (WebCore::StyleResolver::State::State): C++11 cleanup: 0 -> nullptr. 158 (WebCore::StyleResolver::State::setFontSizeHasViewportUnits): Set if 159 the font size is specified in viewport units. 160 (WebCore::StyleResolver::State::fontSizeHasViewportUnits): Ditto. 161 (WebCore::StyleResolver::State::setStyle): Deleted. 162 * css/TransformFunctions.cpp: 163 (WebCore::convertToFloatLength): Remove handling of viewport units, 164 since they are resolved to pixels. 165 * dom/Document.cpp: 166 (WebCore::Document::Document): Add flag to determine if some style in 167 the document has viewport units. 168 (WebCore::Document::pageSizeAndMarginsInPixels): Remove RenderView 169 argument. 170 (WebCore::Document::updateViewportUnitsOnResize): Mark elements with 171 viewport units for style recalc when the viewport size has 172 changed. 173 * dom/Document.h: 174 (WebCore::Document::setHasStyleWithViewportUnits): Flag to determine 175 if some style in the document has viewport units. 176 (WebCore::Document::hasStyleWithViewportUnits): Ditto. 177 * html/HTMLAreaElement.cpp: 178 (WebCore::HTMLAreaElement::getRegion): Remove RenderView argument. 179 * page/FrameView.cpp: 180 (WebCore::FrameView::layout): When the viewport is resized, call 181 updateViewportUnitsOnResize on the document. 182 * platform/Length.h: 183 (WebCore::Length::isSpecified): Remove handling of viewport units, 184 since they are now resolved to pixels. 185 (WebCore::Length::viewportPercentageLength): Deleted. 186 (WebCore::Length::isViewportPercentage): Deleted. 187 * rendering/ClipPathOperation.h: 188 (WebCore::ShapeClipPathOperation::pathForReferenceRect): Remove 189 RenderView argument. 190 (WebCore::BoxClipPathOperation::pathForReferenceRect): Ditto. 191 * rendering/RenderBlock.cpp: 192 (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout): Remove 193 handling of viewport units, since they get updated by 194 updateViewportUnitsOnResize when the viewport is resized. 195 (WebCore::RenderBlock::nodeAtPoint): Remove RenderView argument. 196 (WebCore::RenderBlock::lineHeight): Ditto. 197 * rendering/RenderBox.cpp: 198 (WebCore::RenderBox::paintBoxDecorations): Remove RenderView argument. 199 (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing): 200 Remove handling of viewport units, as they are resolved to pixels. 201 (WebCore::RenderBox::computePercentageLogicalHeight): Ditto. 202 (WebCore::RenderBox::computeReplacedLogicalWidthUsing): Ditto. 203 (WebCore::RenderBox::computeReplacedLogicalHeightUsing): Ditto. 204 (WebCore::RenderBox::hasViewportPercentageLogicalHeight): Deleted. 205 * rendering/RenderBox.h: 206 * rendering/RenderBoxModelObject.cpp: 207 (WebCore::RenderBoxModelObject::getBackgroundRoundedRect): Remove 208 RenderView argument. 209 (WebCore::RenderBoxModelObject::calculateFillTileSize): Remove 210 handling of viewport units, as they are resolved to pixels. 211 (WebCore::computeBorderImageSide): Remove RenderView argument. 212 (WebCore::RenderBoxModelObject::paintNinePieceImage): Ditto. 213 (WebCore::RenderBoxModelObject::paintBorder): Ditto. 214 (WebCore::RenderBoxModelObject::paintBoxShadow): Ditto. 215 * rendering/RenderElement.cpp: 216 (WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto. 217 * rendering/RenderElement.h: 218 (WebCore::RenderElement::valueForLength): Remove unused 219 roundPercentages argument. 220 (WebCore::RenderElement::minimumValueForLength): Remove unused 221 RoundPercentages and RenderView arguments. 222 * rendering/RenderGrid.cpp: 223 (WebCore::RenderGrid::layoutGridItems): Remove handling of viewport 224 units as they are resolved to pixels. 225 * rendering/RenderInline.cpp: 226 (WebCore::computeMargin): Ditto. 227 (WebCore::RenderInline::lineHeight): Remove RenderView argument. 228 * rendering/RenderLayer.cpp: 229 (WebCore::RenderLayer::setupClipPath): Ditto. 230 * rendering/RenderLineBreak.cpp: 231 (WebCore::RenderLineBreak::lineHeight): Ditto. 232 * rendering/RenderScrollbarPart.cpp: 233 (WebCore::calcScrollbarThicknessUsing): Ditto. 234 (WebCore::RenderScrollbarPart::computeScrollbarWidth): Ditto. 235 (WebCore::RenderScrollbarPart::computeScrollbarHeight): Ditto. 236 * rendering/RenderTable.cpp: 237 (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight): 238 Remove handling of viewport units, since they are resolved to 239 pixels. 240 (WebCore::RenderTable::computePreferredLogicalWidths): Now that 241 viewport unit values are resolved to pixels at style recalc time, 242 no special checking is needed to handle them, so update the 243 comment to reflect that. 244 * rendering/RenderThemeIOS.mm: 245 (WebCore::applyCommonButtonPaddingToStyle): Add RenderView argument to 246 CSSToLengthConversionData constructor. 247 (WebCore::RenderThemeIOS::adjustButtonStyle): Ditto. 248 * rendering/RenderThemeMac.mm: 249 (WebCore::RenderThemeMac::paintMenuListButtonGradients): Remove 250 RenderView argument. 251 * rendering/RenderView.cpp: 252 (WebCore::RenderView::layout): Remove handling of viewport units, 253 since they are resolved to pixels. 254 * rendering/RootInlineBox.cpp: 255 (WebCore::RootInlineBox::ascentAndDescentForBox): Remove RenderView 256 argument. 257 * rendering/shapes/Shape.cpp: 258 (WebCore::Shape::createShape): Remove RenderView argument. 259 * rendering/shapes/Shape.h: 260 * rendering/shapes/ShapeOutsideInfo.cpp: 261 (WebCore::ShapeOutsideInfo::computedShape): Ditto. 262 * rendering/style/BasicShapes.cpp: 263 (WebCore::BasicShapeCircle::floatValueForRadiusInBox): Ditto. 264 (WebCore::BasicShapeCircle::path): Ditto. 265 (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto. 266 (WebCore::BasicShapeEllipse::path): Ditto. 267 (WebCore::BasicShapePolygon::path): Ditto. 268 (WebCore::floatSizeForLengthSize): Ditto. 269 (WebCore::BasicShapeInset::path): Ditto. 270 * rendering/style/BasicShapes.h: 271 * rendering/style/RenderStyle.cpp: 272 (WebCore::calcRadiiFor): Ditto. 273 (WebCore::RenderStyle::getRoundedBorderFor): Ditto. 274 (WebCore::RenderStyle::computedLineHeight): Remove handling of 275 viewport units since they are resolved to pixels. 276 * rendering/style/RenderStyle.h: 277 (WebCore::RenderStyle::setHasViewportUnits): Set if this style has 278 a property set with viewport units. 279 (WebCore::RenderStyle::hasViewportUnits): Ditto. 280 * rendering/svg/RenderSVGRoot.cpp: 281 (WebCore::resolveLengthAttributeForSVG): Remove RenderView argument. 282 (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): Ditto. 283 (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): Ditto. 284 * rendering/svg/SVGRenderingContext.cpp: 285 (WebCore::SVGRenderingContext::prepareToRenderSVGContent): Ditto. 286 1 287 2014-05-27 Zoltan Horvath <zoltan@webkit.org> 2 288 -
trunk/Source/WebCore/WebCore.exp.in
r169380 r169407 825 825 __ZN7WebCore19TextResourceDecoderD1Ev 826 826 __ZN7WebCore19enclosingLayoutRectERKNS_9FloatRectE 827 __ZN7WebCore19floatValueForLengthERKNS_6LengthEf PNS_10RenderViewE827 __ZN7WebCore19floatValueForLengthERKNS_6LengthEf 828 828 __ZN7WebCore19getFileCreationTimeERKN3WTF6StringERl 829 829 __ZN7WebCore19toInt32EnforceRangeEPN3JSC9ExecStateENS0_7JSValueE -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
r165656 r169407 126 126 127 127 if (!style->textIndent().isUndefined()) { 128 int indentation = valueForLength(style->textIndent(), object->size().width() , &renderer->view());128 int indentation = valueForLength(style->textIndent(), object->size().width()); 129 129 buffer.reset(g_strdup_printf("%i", indentation)); 130 130 result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_INDENT), buffer.get()); -
trunk/Source/WebCore/css/BasicShapeFunctions.cpp
r168481 r169407 37 37 #include "Pair.h" 38 38 #include "RenderStyle.h" 39 #include "RenderView.h"40 39 41 40 namespace WebCore { … … 131 130 static Length convertToLength(const CSSToLengthConversionData& conversionData, CSSPrimitiveValue* value) 132 131 { 133 return value->convertToLength<FixedIntegerConversion | FixedFloatConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(conversionData);132 return value->convertToLength<FixedIntegerConversion | FixedFloatConversion | PercentConversion | CalculatedConversion>(conversionData); 134 133 } 135 134 … … 266 265 } 267 266 268 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate& center, float boxDimension , RenderView* view)269 { 270 float offset = floatValueForLength(center.length(), boxDimension , view);267 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate& center, float boxDimension) 268 { 269 float offset = floatValueForLength(center.length(), boxDimension); 271 270 if (center.direction() == BasicShapeCenterCoordinate::TopLeft) 272 271 return offset; -
trunk/Source/WebCore/css/BasicShapeFunctions.h
r168481 r169407 37 37 38 38 class CSSBasicShape; 39 class CSSToLengthConversionData; 39 40 class CSSPrimitiveValue; 40 41 class CSSToLengthConversionData; 41 42 class CSSValue; 42 43 class RenderStyle; 43 class RenderView;44 44 45 45 PassRefPtr<CSSValue> valueForBasicShape(const RenderStyle*, const BasicShape*); 46 46 PassRefPtr<BasicShape> basicShapeForValue(const CSSToLengthConversionData&, const CSSBasicShape*); 47 47 48 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&, float , RenderView*);48 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&, float); 49 49 } 50 50 -
trunk/Source/WebCore/css/CSSCalculationValue.cpp
r168685 r169407 67 67 case CSSPrimitiveValue::CSS_REMS: 68 68 case CSSPrimitiveValue::CSS_CHS: 69 case CSSPrimitiveValue::CSS_VW: 70 case CSSPrimitiveValue::CSS_VH: 71 case CSSPrimitiveValue::CSS_VMIN: 72 case CSSPrimitiveValue::CSS_VMAX: 69 73 return CalcLength; 70 74 case CSSPrimitiveValue::CSS_PERCENTAGE: … … 722 726 switch (length.type()) { 723 727 case Percent: 724 case ViewportPercentageWidth:725 case ViewportPercentageHeight:726 case ViewportPercentageMin:727 case ViewportPercentageMax:728 728 case Fixed: 729 729 return CSSCalcPrimitiveValue::create(CSSPrimitiveValue::create(length, &style), length.value() == trunc(length.value())); -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r169349 r169407 58 58 #include "RenderBox.h" 59 59 #include "RenderStyle.h" 60 #include "RenderView.h"61 60 #include "SVGElement.h" 62 61 #include "StyleInheritedData.h" … … 655 654 } 656 655 657 static PassRefPtr<CSSValue> positionOffsetValue(RenderStyle* style, CSSPropertyID propertyID , RenderView* renderView)656 static PassRefPtr<CSSValue> positionOffsetValue(RenderStyle* style, CSSPropertyID propertyID) 658 657 { 659 658 if (!style) … … 681 680 if (l.isFixed()) 682 681 return zoomAdjustedPixelValue(l.value(), style); 683 if (l.isViewportPercentage()) 684 return zoomAdjustedPixelValue(valueForLength(l, 0, renderView), style); 682 685 683 return cssValuePool().createValue(l); 686 684 } … … 704 702 } 705 703 706 static PassRef<CSSValueList> getBorderRadiusCornerValues(const LengthSize& radius, const RenderStyle* style , RenderView* renderView)704 static PassRef<CSSValueList> getBorderRadiusCornerValues(const LengthSize& radius, const RenderStyle* style) 707 705 { 708 706 auto list = CSSValueList::createSpaceSeparated(); … … 710 708 list.get().append(cssValuePool().createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); 711 709 else 712 list.get().append(zoomAdjustedPixelValue(valueForLength(radius.width(), 0 , renderView), style));710 list.get().append(zoomAdjustedPixelValue(valueForLength(radius.width(), 0), style)); 713 711 if (radius.height().isPercentNotCalculated()) 714 712 list.get().append(cssValuePool().createValue(radius.height().percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); 715 713 else 716 list.get().append(zoomAdjustedPixelValue(valueForLength(radius.height(), 0 , renderView), style));714 list.get().append(zoomAdjustedPixelValue(valueForLength(radius.height(), 0), style)); 717 715 return list; 718 716 } 719 717 720 static PassRef<CSSValue> getBorderRadiusCornerValue(const LengthSize& radius, const RenderStyle* style , RenderView* renderView)718 static PassRef<CSSValue> getBorderRadiusCornerValue(const LengthSize& radius, const RenderStyle* style) 721 719 { 722 720 if (radius.width() == radius.height()) { 723 721 if (radius.width().isPercentNotCalculated()) 724 722 return cssValuePool().createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE); 725 return zoomAdjustedPixelValue(valueForLength(radius.width(), 0 , renderView), style);726 } 727 return getBorderRadiusCornerValues(radius, style , renderView);728 } 729 730 static PassRef<CSSValueList> getBorderRadiusShorthandValue(const RenderStyle* style , RenderView* renderView)723 return zoomAdjustedPixelValue(valueForLength(radius.width(), 0), style); 724 } 725 return getBorderRadiusCornerValues(radius, style); 726 } 727 728 static PassRef<CSSValueList> getBorderRadiusShorthandValue(const RenderStyle* style) 731 729 { 732 730 auto list = CSSValueList::createSlashSeparated(); … … 739 737 bool showVerticalTopRight = showVerticalBottomRight || (style->borderTopRightRadius().height() != style->borderTopLeftRadius().height()); 740 738 741 RefPtr<CSSValueList> topLeftRadius = getBorderRadiusCornerValues(style->borderTopLeftRadius(), style , renderView);742 RefPtr<CSSValueList> topRightRadius = getBorderRadiusCornerValues(style->borderTopRightRadius(), style , renderView);743 RefPtr<CSSValueList> bottomRightRadius = getBorderRadiusCornerValues(style->borderBottomRightRadius(), style , renderView);744 RefPtr<CSSValueList> bottomLeftRadius = getBorderRadiusCornerValues(style->borderBottomLeftRadius(), style , renderView);739 RefPtr<CSSValueList> topLeftRadius = getBorderRadiusCornerValues(style->borderTopLeftRadius(), style); 740 RefPtr<CSSValueList> topRightRadius = getBorderRadiusCornerValues(style->borderTopRightRadius(), style); 741 RefPtr<CSSValueList> bottomRightRadius = getBorderRadiusCornerValues(style->borderBottomRightRadius(), style); 742 RefPtr<CSSValueList> bottomLeftRadius = getBorderRadiusCornerValues(style->borderBottomLeftRadius(), style); 745 743 746 744 RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated(); … … 959 957 960 958 #if ENABLE(CSS_GRID_LAYOUT) 961 static PassRef<CSSValue> specifiedValueForGridTrackBreadth(const GridLength& trackBreadth, const RenderStyle* style , RenderView* renderView)959 static PassRef<CSSValue> specifiedValueForGridTrackBreadth(const GridLength& trackBreadth, const RenderStyle* style) 962 960 { 963 961 if (!trackBreadth.isLength()) … … 967 965 if (trackBreadthLength.isAuto()) 968 966 return cssValuePool().createIdentifierValue(CSSValueAuto); 969 if (trackBreadthLength.isViewportPercentage())970 return zoomAdjustedPixelValue(valueForLength(trackBreadthLength, 0, renderView), style);971 967 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); 972 968 } 973 969 974 static PassRefPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const RenderStyle* style , RenderView* renderView)970 static PassRefPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const RenderStyle* style) 975 971 { 976 972 switch (trackSize.type()) { 977 973 case LengthTrackSizing: 978 return specifiedValueForGridTrackBreadth(trackSize.length(), style , renderView);974 return specifiedValueForGridTrackBreadth(trackSize.length(), style); 979 975 case MinMaxTrackSizing: 980 976 RefPtr<CSSValueList> minMaxTrackBreadths = CSSValueList::createCommaSeparated(); 981 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), style , renderView));982 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.maxTrackBreadth(), style , renderView));977 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), style)); 978 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.maxTrackBreadth(), style)); 983 979 return CSSFunctionValue::create("minmax(", minMaxTrackBreadths); 984 980 } … … 999 995 } 1000 996 1001 static PassRef<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, RenderObject* renderer, const RenderStyle* style , RenderView* renderView)997 static PassRef<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, RenderObject* renderer, const RenderStyle* style) 1002 998 { 1003 999 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style->gridColumns() : style->gridRows(); … … 1024 1020 for (unsigned i = 0; i < trackSizes.size(); ++i) { 1025 1021 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, list.get()); 1026 list.get().append(specifiedValueForGridTrackSize(trackSizes[i], style , renderView));1022 list.get().append(specifiedValueForGridTrackSize(trackSizes[i], style)); 1027 1023 } 1028 1024 } … … 1450 1446 } 1451 1447 1452 static PassRef<CSSPrimitiveValue> lineHeightFromStyle(RenderStyle* style , RenderView* renderView)1448 static PassRef<CSSPrimitiveValue> lineHeightFromStyle(RenderStyle* style) 1453 1449 { 1454 1450 Length length = style->lineHeight(); … … 1462 1458 return zoomAdjustedPixelValue(static_cast<int>(length.percent() * style->fontDescription().specifiedSize()) / 100, style); 1463 1459 } 1464 return zoomAdjustedPixelValue(floatValueForLength(length, 0 , renderView), style);1460 return zoomAdjustedPixelValue(floatValueForLength(length, 0), style); 1465 1461 } 1466 1462 … … 1879 1875 return zoomAdjustedPixelValue(style->borderLeftWidth(), style.get()); 1880 1876 case CSSPropertyBottom: 1881 return positionOffsetValue(style.get(), CSSPropertyBottom , m_node->document().renderView());1877 return positionOffsetValue(style.get(), CSSPropertyBottom); 1882 1878 case CSSPropertyWebkitBoxAlign: 1883 1879 return cssValuePool().createValue(style->boxAlign()); … … 2023 2019 computedFont->weight = fontWeightFromStyle(style.get()); 2024 2020 computedFont->size = fontSizeFromStyle(style.get()); 2025 computedFont->lineHeight = lineHeightFromStyle(style.get() , m_node->document().renderView());2021 computedFont->lineHeight = lineHeightFromStyle(style.get()); 2026 2022 computedFont->family = fontFamilyFromStyle(style.get()); 2027 2023 return computedFont.release(); … … 2064 2060 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html 2065 2061 case CSSPropertyWebkitGridAutoColumns: 2066 return specifiedValueForGridTrackSize(style->gridAutoColumns(), style.get() , m_node->document().renderView());2062 return specifiedValueForGridTrackSize(style->gridAutoColumns(), style.get()); 2067 2063 case CSSPropertyWebkitGridAutoRows: 2068 return specifiedValueForGridTrackSize(style->gridAutoRows(), style.get() , m_node->document().renderView());2064 return specifiedValueForGridTrackSize(style->gridAutoRows(), style.get()); 2069 2065 2070 2066 case CSSPropertyWebkitGridTemplateColumns: 2071 return valueForGridTrackList(ForColumns, renderer, style.get() , m_node->document().renderView());2067 return valueForGridTrackList(ForColumns, renderer, style.get()); 2072 2068 case CSSPropertyWebkitGridTemplateRows: 2073 return valueForGridTrackList(ForRows, renderer, style.get() , m_node->document().renderView());2069 return valueForGridTrackList(ForRows, renderer, style.get()); 2074 2070 2075 2071 case CSSPropertyWebkitGridColumnStart: … … 2142 2138 #endif 2143 2139 case CSSPropertyLeft: 2144 return positionOffsetValue(style.get(), CSSPropertyLeft , m_node->document().renderView());2140 return positionOffsetValue(style.get(), CSSPropertyLeft); 2145 2141 case CSSPropertyLetterSpacing: 2146 2142 if (!style->letterSpacing()) … … 2152 2148 return cssValuePool().createValue(style->lineClamp().value(), style->lineClamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveValue::CSS_NUMBER); 2153 2149 case CSSPropertyLineHeight: 2154 return lineHeightFromStyle(style.get() , m_node->document().renderView());2150 return lineHeightFromStyle(style.get()); 2155 2151 case CSSPropertyListStyleImage: 2156 2152 if (style->listStyleImage()) … … 2172 2168 return zoomAdjustedPixelValueForLength(marginRight, style.get()); 2173 2169 float value; 2174 if (marginRight.isPercent() || marginRight.isViewportPercentage()) {2170 if (marginRight.isPercent()) { 2175 2171 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box 2176 2172 // and the right-edge of the containing box, when display == BLOCK. Let's calculate the absolute 2177 2173 // value of the specified margin-right % instead of relying on RenderBox's marginRight() value. 2178 value = minimumValueForLength(marginRight, toRenderBox(renderer)->containingBlockLogicalWidthForContent() , m_node->document().renderView());2174 value = minimumValueForLength(marginRight, toRenderBox(renderer)->containingBlockLogicalWidthForContent()); 2179 2175 } else 2180 2176 value = toRenderBox(renderer)->marginRight(); … … 2267 2263 return cssValuePool().createValue(style->position()); 2268 2264 case CSSPropertyRight: 2269 return positionOffsetValue(style.get(), CSSPropertyRight , m_node->document().renderView());2265 return positionOffsetValue(style.get(), CSSPropertyRight); 2270 2266 case CSSPropertyWebkitRubyPosition: 2271 2267 return cssValuePool().createValue(style->rubyPosition()); … … 2368 2364 return cssValuePool().createValue(style->textTransform()); 2369 2365 case CSSPropertyTop: 2370 return positionOffsetValue(style.get(), CSSPropertyTop , m_node->document().renderView());2366 return positionOffsetValue(style.get(), CSSPropertyTop); 2371 2367 case CSSPropertyUnicodeBidi: 2372 2368 return cssValuePool().createValue(style->unicodeBidi()); … … 2634 2630 box = toRenderBox(renderer)->borderBoxRect(); 2635 2631 2636 RenderView* renderView = m_node->document().renderView(); 2637 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->perspectiveOriginX(), box.width(), renderView), style.get())); 2638 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->perspectiveOriginY(), box.height(), renderView), style.get())); 2632 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->perspectiveOriginX(), box.width()), style.get())); 2633 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->perspectiveOriginY(), box.height()), style.get())); 2639 2634 } 2640 2635 else { … … 2666 2661 return cssValuePool().createValue(style->userSelect()); 2667 2662 case CSSPropertyBorderBottomLeftRadius: 2668 return getBorderRadiusCornerValue(style->borderBottomLeftRadius(), style.get() , m_node->document().renderView());2663 return getBorderRadiusCornerValue(style->borderBottomLeftRadius(), style.get()); 2669 2664 case CSSPropertyBorderBottomRightRadius: 2670 return getBorderRadiusCornerValue(style->borderBottomRightRadius(), style.get() , m_node->document().renderView());2665 return getBorderRadiusCornerValue(style->borderBottomRightRadius(), style.get()); 2671 2666 case CSSPropertyBorderTopLeftRadius: 2672 return getBorderRadiusCornerValue(style->borderTopLeftRadius(), style.get() , m_node->document().renderView());2667 return getBorderRadiusCornerValue(style->borderTopLeftRadius(), style.get()); 2673 2668 case CSSPropertyBorderTopRightRadius: 2674 return getBorderRadiusCornerValue(style->borderTopRightRadius(), style.get() , m_node->document().renderView());2669 return getBorderRadiusCornerValue(style->borderTopRightRadius(), style.get()); 2675 2670 case CSSPropertyClip: { 2676 2671 if (!style->hasClip()) … … 2694 2689 box = toRenderBox(renderer)->borderBoxRect(); 2695 2690 2696 RenderView* renderView = m_node->document().renderView(); 2697 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginX(), box.width(), renderView), style.get())); 2698 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginY(), box.height(), renderView), style.get())); 2691 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginX(), box.width()), style.get())); 2692 list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginY(), box.height()), style.get())); 2699 2693 if (style->transformOriginZ() != 0) 2700 2694 list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get())); … … 2857 2851 return valueForNinePieceImage(style->borderImage()); 2858 2852 case CSSPropertyBorderRadius: 2859 return getBorderRadiusShorthandValue(style.get() , m_node->document().renderView());2853 return getBorderRadiusShorthandValue(style.get()); 2860 2854 case CSSPropertyBorderRight: 2861 2855 return getCSSPropertyValuesForShorthandProperties(borderRightShorthand()); -
trunk/Source/WebCore/css/CSSGradientValue.cpp
r169258 r169407 37 37 #include "NodeRenderStyle.h" 38 38 #include "RenderElement.h" 39 #include "RenderView.h" 39 40 #include "StyleResolver.h" 40 41 #include <wtf/text/StringBuilder.h> … … 130 131 } 131 132 132 void CSSGradientValue::addStops(Gradient& gradient, RenderView& renderView,const CSSToLengthConversionData& conversionData, float maxLengthForRepeat)133 void CSSGradientValue::addStops(Gradient& gradient, const CSSToLengthConversionData& conversionData, float maxLengthForRepeat) 133 134 { 134 135 if (m_gradientType == CSSDeprecatedLinearGradient || m_gradientType == CSSDeprecatedRadialGradient) { … … 183 184 if (positionValue.isLength()) 184 185 length = positionValue.computeLength<float>(conversionData); 185 else if (positionValue.isViewportPercentageLength())186 length = valueForLength(positionValue.viewportPercentageLength(), 0, &renderView);187 186 else { 188 187 Ref<CalculationValue> calculationValue { positionValue.cssCalcValue()->createCalculationValue(conversionData) }; … … 648 647 ASSERT(!size.isEmpty()); 649 648 650 CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle() );649 CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), &renderer.view()); 651 650 652 651 FloatPoint firstPoint; … … 705 704 706 705 // Now add the stops. 707 addStops(*gradient, renderer.view(),conversionData, 1);706 addStops(*gradient, conversionData, 1); 708 707 709 708 return gradient.release(); … … 986 985 ASSERT(!size.isEmpty()); 987 986 988 CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle() );987 CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), &renderer.view()); 989 988 990 989 FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size); … … 1119 1118 1120 1119 // Now add the stops. 1121 addStops(*gradient, renderer.view(),conversionData, maxExtent);1120 addStops(*gradient, conversionData, maxExtent); 1122 1121 1123 1122 return gradient.release(); -
trunk/Source/WebCore/css/CSSGradientValue.h
r169258 r169407 111 111 } 112 112 113 void addStops(Gradient&, RenderView&,const CSSToLengthConversionData&, float maxLengthForRepeat = 0);113 void addStops(Gradient&, const CSSToLengthConversionData&, float maxLengthForRepeat = 0); 114 114 115 115 // Resolve points/radii to front end values. -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r168685 r169407 160 160 case CSS_KHZ: 161 161 return UFrequency; 162 case CSS_VW:163 case CSS_VH:164 case CSS_VMIN:165 case CSS_VMAX:166 return UViewportPercentageLength;167 162 #if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY) 168 163 case CSS_DPPX: … … 302 297 case FitContent: 303 298 case Percent: 304 case ViewportPercentageWidth:305 case ViewportPercentageHeight:306 case ViewportPercentageMin:307 case ViewportPercentageMax:308 299 init(length); 309 300 return; … … 371 362 m_value.num = length.percent(); 372 363 return; 373 case ViewportPercentageWidth:374 m_primitiveUnitType = CSS_VW;375 m_value.num = length.viewportPercentageLength();376 return;377 case ViewportPercentageHeight:378 m_primitiveUnitType = CSS_VH;379 m_value.num = length.viewportPercentageLength();380 return;381 case ViewportPercentageMin:382 m_primitiveUnitType = CSS_VMIN;383 m_value.num = length.viewportPercentageLength();384 return;385 case ViewportPercentageMax:386 m_primitiveUnitType = CSS_VMAX;387 m_value.num = length.viewportPercentageLength();388 return;389 364 case Calculated: 390 365 case Relative: … … 658 633 return -1.0; 659 634 case CSS_VH: 635 factor = conversionData.viewportHeightFactor(); 636 break; 660 637 case CSS_VW: 638 factor = conversionData.viewportWidthFactor(); 639 break; 661 640 case CSS_VMAX: 641 factor = conversionData.viewportMaxFactor(); 642 break; 662 643 case CSS_VMIN: 663 factor = 1.0;644 factor = conversionData.viewportMinFactor(); 664 645 break; 665 646 default: … … 780 761 case UFrequency: 781 762 return CSS_HZ; 782 case UViewportPercentageLength:783 return CSS_UNKNOWN; // Cannot convert between numbers and relative lengths.784 763 #if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY) 785 764 case UResolution: … … 1223 1202 if (m_primitiveUnitType == CSS_URI) 1224 1203 addSubresourceURL(urls, styleSheet->completeURL(m_value.string)); 1225 }1226 1227 Length CSSPrimitiveValue::viewportPercentageLength() const1228 {1229 ASSERT(isViewportPercentageLength());1230 Length viewportLength;1231 switch (m_primitiveUnitType) {1232 case CSS_VW:1233 viewportLength = Length(getDoubleValue(), ViewportPercentageWidth);1234 break;1235 case CSS_VH:1236 viewportLength = Length(getDoubleValue(), ViewportPercentageHeight);1237 break;1238 case CSS_VMIN:1239 viewportLength = Length(getDoubleValue(), ViewportPercentageMin);1240 break;1241 case CSS_VMAX:1242 viewportLength = Length(getDoubleValue(), ViewportPercentageMax);1243 break;1244 default:1245 break;1246 }1247 return viewportLength;1248 1204 } 1249 1205 -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r167937 r169407 149 149 UTime, 150 150 UFrequency, 151 UViewportPercentageLength,152 151 #if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY) 153 152 UResolution, … … 177 176 { 178 177 unsigned short type = primitiveType(); 179 return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type == CSS_CHS ;178 return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type == CSS_CHS || isViewportPercentageLength(); 180 179 } 181 180 bool isNumber() const { return primitiveType() == CSS_NUMBER; } … … 330 329 void addSubresourceStyleURLs(ListHashSet<URL>&, const StyleSheetContents*) const; 331 330 332 Length viewportPercentageLength() const;333 334 331 PassRefPtr<CSSPrimitiveValue> cloneForCSSOM() const; 335 332 void setCSSOMSafe() { m_isCSSOMSafe = true; } -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r168839 r169407 4625 4625 PercentConversion = 1 << 3, 4626 4626 FractionConversion = 1 << 4, 4627 CalculatedConversion = 1 << 5, 4628 ViewportPercentageConversion = 1 << 6 4627 CalculatedConversion = 1 << 5 4629 4628 }; 4630 4629 … … 4645 4644 if ((supported & CalculatedConversion) && isCalculated()) 4646 4645 return Length(cssCalcValue()->createCalculationValue(conversionData)); 4647 if ((supported & ViewportPercentageConversion) && isViewportPercentageLength())4648 return viewportPercentageLength();4649 4646 return Length(Undefined); 4650 4647 } -
trunk/Source/WebCore/css/CSSToLengthConversionData.cpp
r167937 r169407 33 33 34 34 #include "RenderStyle.h" 35 #include "RenderView.h" 35 36 36 37 namespace WebCore { … … 43 44 } 44 45 46 double CSSToLengthConversionData::viewportWidthFactor() const 47 { 48 if (m_style && !m_computingFontSize) 49 m_style->setHasViewportUnits(); 50 return m_renderView ? m_renderView->viewportSizeForCSSViewportUnits().width() / 100.0 : 0.0; 51 } 52 53 double CSSToLengthConversionData::viewportHeightFactor() const 54 { 55 if (m_style && !m_computingFontSize) 56 m_style->setHasViewportUnits(); 57 58 if (!m_renderView) 59 return 0.0; 60 61 return m_renderView ? m_renderView->viewportSizeForCSSViewportUnits().height() / 100.0 : 0.0; 62 } 63 64 double CSSToLengthConversionData::viewportMinFactor() const 65 { 66 if (m_style && !m_computingFontSize) 67 m_style->setHasViewportUnits(); 68 69 if (!m_renderView) 70 return 0.0; 71 72 IntSize viewportSizeForCSSViewportUnits = m_renderView->viewportSizeForCSSViewportUnits(); 73 return std::min(viewportSizeForCSSViewportUnits.width(), viewportSizeForCSSViewportUnits.height()) / 100.0; 74 } 75 76 double CSSToLengthConversionData::viewportMaxFactor() const 77 { 78 if (m_style && !m_computingFontSize) 79 m_style->setHasViewportUnits(); 80 81 if (!m_renderView) 82 return 0.0; 83 84 IntSize viewportSizeForCSSViewportUnits = m_renderView->viewportSizeForCSSViewportUnits(); 85 return std::max(viewportSizeForCSSViewportUnits.width(), viewportSizeForCSSViewportUnits.height()) / 100.0; 86 } 87 45 88 } // namespace WebCore -
trunk/Source/WebCore/css/CSSToLengthConversionData.h
r167937 r169407 38 38 39 39 class RenderStyle; 40 class RenderView; 40 41 41 42 class CSSToLengthConversionData { 42 43 public: 43 CSSToLengthConversionData( const RenderStyle* style, const RenderStyle* rootStyle, float zoom, bool computingFontSize = false)44 CSSToLengthConversionData(RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, float zoom, bool computingFontSize = false) 44 45 : m_style(style) 45 46 , m_rootStyle(rootStyle) 47 , m_renderView(renderView) 46 48 , m_zoom(zoom) 47 49 , m_useEffectiveZoom(false) … … 50 52 ASSERT(zoom > 0); 51 53 } 52 CSSToLengthConversionData( const RenderStyle* style = nullptr, const RenderStyle* rootStyle = nullptr, bool computingFontSize = false)54 CSSToLengthConversionData(RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, bool computingFontSize = false) 53 55 : m_style(style) 54 56 , m_rootStyle(rootStyle) 57 , m_renderView(renderView) 55 58 , m_useEffectiveZoom(true) 56 59 , m_computingFontSize(computingFontSize) 57 60 { 58 61 } 62 CSSToLengthConversionData() 63 : CSSToLengthConversionData(nullptr, nullptr, nullptr) 64 { 65 } 59 66 60 constRenderStyle* style() const { return m_style; }67 RenderStyle* style() const { return m_style; } 61 68 const RenderStyle* rootStyle() const { return m_rootStyle; } 62 69 float zoom() const; 63 70 bool computingFontSize() const { return m_computingFontSize; } 64 71 72 double viewportWidthFactor() const; 73 double viewportHeightFactor() const; 74 double viewportMinFactor() const; 75 double viewportMaxFactor() const; 76 65 77 CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const 66 78 { 67 return CSSToLengthConversionData(m_style, m_rootStyle, newZoom, m_computingFontSize);79 return CSSToLengthConversionData(m_style, m_rootStyle, m_renderView, newZoom, m_computingFontSize); 68 80 } 69 81 70 82 private: 71 constRenderStyle* m_style;83 RenderStyle* m_style; 72 84 const RenderStyle* m_rootStyle; 85 const RenderView* m_renderView; 73 86 float m_zoom; 74 87 bool m_useEffectiveZoom; -
trunk/Source/WebCore/css/CSSToStyleMap.cpp
r167937 r169407 38 38 #include "Pair.h" 39 39 #include "Rect.h" 40 #include "RenderView.h" 40 41 #include "StyleResolver.h" 41 42 … … 51 52 return m_resolver->style(); 52 53 } 53 54 54 55 RenderStyle* CSSToStyleMap::rootElementStyle() const 55 56 { … … 61 62 return m_resolver->useSVGZoomRules(); 62 63 } 63 64 64 65 PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSValue* value) 65 66 { … … 254 255 else if (primitiveValue->isCalculatedPercentageWithLength()) 255 256 length = Length(primitiveValue->cssCalcValue()->createCalculationValue(m_resolver->state().cssToLengthConversionData())); 256 else if (primitiveValue->isViewportPercentageLength())257 length = primitiveValue->viewportPercentageLength();258 257 else 259 258 return; … … 288 287 else if (primitiveValue->isCalculatedPercentageWithLength()) 289 288 length = Length(primitiveValue->cssCalcValue()->createCalculationValue(m_resolver->state().cssToLengthConversionData())); 290 else if (primitiveValue->isViewportPercentageLength())291 length = primitiveValue->viewportPercentageLength();292 289 else 293 290 return; -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r167937 r169407 395 395 else if (primitiveValue->isCalculatedPercentageWithLength()) 396 396 setValue(styleResolver->style(), Length(primitiveValue->cssCalcValue()->createCalculationValue(styleResolver->state().cssToLengthConversionData()))); 397 else if (primitiveValue->isViewportPercentageLength())398 setValue(styleResolver->style(), primitiveValue->viewportPercentageLength());399 397 } 400 398 … … 447 445 if (pair->first()->isPercentage()) 448 446 radiusWidth = Length(pair->first()->getDoubleValue(), Percent); 449 else if (pair->first()->isViewportPercentageLength())450 radiusWidth = Length(styleResolver->viewportPercentageValue(*pair->first(), pair->first()->getIntValue()), Fixed);451 447 else if (pair->first()->isCalculatedPercentageWithLength()) 452 448 radiusWidth = Length(pair->first()->cssCalcValue()->createCalculationValue(conversionData)); … … 457 453 if (pair->second()->isPercentage()) 458 454 radiusHeight = Length(pair->second()->getDoubleValue(), Percent); 459 else if (pair->second()->isViewportPercentageLength())460 radiusHeight = Length(styleResolver->viewportPercentageValue(*pair->second(), pair->second()->getIntValue()), Fixed);461 455 else if (pair->second()->isCalculatedPercentageWithLength()) 462 456 radiusHeight = Length(pair->second()->cssCalcValue()->createCalculationValue(conversionData)); … … 623 617 length = 1.0; 624 618 } 625 if (primitiveValue->isViewportPercentageLength())626 length = styleResolver->viewportPercentageValue(*primitiveValue, length);627 619 } else { 628 620 ASSERT_NOT_REACHED(); … … 869 861 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize 870 862 || !(primitiveValue->isPercentage() || primitiveValue->isFontRelativeLength())); 871 if (primitiveValue->isLength()) 872 size = primitiveValue->computeLength<float>(CSSToLengthConversionData(styleResolver->parentStyle(), styleResolver->rootElementStyle(), 1.0f, true)); 873 else if (primitiveValue->isPercentage()) 863 if (primitiveValue->isLength()) { 864 size = primitiveValue->computeLength<float>(CSSToLengthConversionData(styleResolver->parentStyle(), styleResolver->rootElementStyle(), styleResolver->document().renderView(), 1.0f, true)); 865 styleResolver->state().setFontSizeHasViewportUnits(primitiveValue->isViewportPercentageLength()); 866 } else if (primitiveValue->isPercentage()) 874 867 size = (primitiveValue->getFloatValue() * parentSize) / 100.0f; 875 868 else if (primitiveValue->isCalculatedPercentageWithLength()) { 876 869 Ref<CalculationValue> calculationValue { primitiveValue->cssCalcValue()->createCalculationValue(styleResolver->state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) }; 877 870 size = calculationValue->evaluate(parentSize); 878 } else if (primitiveValue->isViewportPercentageLength()) 879 size = valueForLength(primitiveValue->viewportPercentageLength(), 0, styleResolver->document().renderView()); 880 else 871 } else 881 872 return; 882 873 } … … 1459 1450 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent). 1460 1451 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent); 1461 } else if (primitiveValue->isViewportPercentageLength()) 1462 lineHeight = primitiveValue->viewportPercentageLength(); 1463 else 1452 } else 1464 1453 return; 1465 1454 styleResolver->style()->setLineHeight(lineHeight); … … 1499 1488 else 1500 1489 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent); 1501 } else if (primitiveValue->isViewportPercentageLength()) 1502 lineHeight = primitiveValue->viewportPercentageLength(); 1503 else 1490 } else 1504 1491 return; 1505 1492 styleResolver->style()->setLineHeight(lineHeight); … … 1544 1531 else if (primitiveValue->isNumber()) 1545 1532 wordSpacing = Length(primitiveValue->getDoubleValue(), Fixed); 1546 else if (primitiveValue->isViewportPercentageLength())1547 wordSpacing = Length(styleResolver->viewportPercentageValue(*primitiveValue, primitiveValue->getDoubleValue()), Fixed);1548 1533 else 1549 1534 return; … … 1961 1946 return styleResolver->style()->setVerticalAlign(*primitiveValue); 1962 1947 1963 styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->state().cssToLengthConversionData()));1948 styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(styleResolver->state().cssToLengthConversionData())); 1964 1949 } 1965 1950 … … 2301 2286 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item); 2302 2287 if (!primitiveValue->getValueID()) 2303 lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->state().cssToLengthConversionData());2288 lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(styleResolver->state().cssToLengthConversionData()); 2304 2289 #if ENABLE(CSS3_TEXT) 2305 2290 else if (primitiveValue->getValueID() == CSSValueWebkitEachLine) -
trunk/Source/WebCore/css/LengthFunctions.cpp
r169245 r169407 25 25 #include "LengthFunctions.h" 26 26 27 #include "FloatSize.h" 27 28 #include "LayoutUnit.h" 28 29 #include "LengthSize.h" 29 #include "RenderView.h"30 30 31 31 namespace WebCore { 32 32 33 int minimumIntValueForLength(const Length& length, LayoutUnit maximumValue, RenderView* renderView,bool roundPercentages)33 int minimumIntValueForLength(const Length& length, LayoutUnit maximumValue, bool roundPercentages) 34 34 { 35 return static_cast<int>(minimumValueForLength(length, maximumValue, r enderView, roundPercentages));35 return static_cast<int>(minimumValueForLength(length, maximumValue, roundPercentages)); 36 36 } 37 37 38 int intValueForLength(const Length& length, LayoutUnit maximumValue , RenderView* renderView, bool roundPercentages)38 int intValueForLength(const Length& length, LayoutUnit maximumValue) 39 39 { 40 return static_cast<int>(valueForLength(length, maximumValue , renderView, roundPercentages));40 return static_cast<int>(valueForLength(length, maximumValue)); 41 41 } 42 42 43 LayoutUnit minimumValueForLength(const Length& length, LayoutUnit maximumValue, RenderView* renderView,bool roundPercentages)43 LayoutUnit minimumValueForLength(const Length& length, LayoutUnit maximumValue, bool roundPercentages) 44 44 { 45 45 switch (length.type()) { … … 53 53 case Calculated: 54 54 return length.nonNanCalculatedValue(maximumValue); 55 case ViewportPercentageWidth:56 if (renderView)57 return LayoutUnit(renderView->viewportSizeForCSSViewportUnits().width() * length.viewportPercentageLength() / 100.0f);58 return 0;59 case ViewportPercentageHeight:60 if (renderView)61 return LayoutUnit(renderView->viewportSizeForCSSViewportUnits().height() * length.viewportPercentageLength() / 100.0f);62 return 0;63 case ViewportPercentageMin:64 if (renderView) {65 IntSize viewportSize = renderView->viewportSizeForCSSViewportUnits();66 return LayoutUnit(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);67 }68 return 0;69 case ViewportPercentageMax:70 if (renderView) {71 IntSize viewportSize = renderView->viewportSizeForCSSViewportUnits();72 return LayoutUnit(std::max(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);73 }74 return 0;75 55 case FillAvailable: 76 56 case Auto: … … 90 70 } 91 71 92 LayoutUnit valueForLength(const Length& length, LayoutUnit maximumValue , RenderView* renderView, bool roundPercentages)72 LayoutUnit valueForLength(const Length& length, LayoutUnit maximumValue) 93 73 { 94 74 switch (length.type()) { … … 96 76 case Percent: 97 77 case Calculated: 98 case ViewportPercentageWidth: 99 case ViewportPercentageHeight: 100 case ViewportPercentageMin: 101 case ViewportPercentageMax: 102 return minimumValueForLength(length, maximumValue, renderView, roundPercentages); 78 return minimumValueForLength(length, maximumValue); 103 79 case FillAvailable: 104 80 case Auto: … … 119 95 120 96 // FIXME: when subpixel layout is supported this copy of floatValueForLength() can be removed. See bug 71143. 121 float floatValueForLength(const Length& length, LayoutUnit maximumValue , RenderView* renderView)97 float floatValueForLength(const Length& length, LayoutUnit maximumValue) 122 98 { 123 99 switch (length.type()) { … … 130 106 return static_cast<float>(maximumValue); 131 107 case Calculated: 132 return length.nonNanCalculatedValue(maximumValue); 133 case ViewportPercentageWidth: 134 if (renderView) 135 return static_cast<int>(renderView->viewportSizeForCSSViewportUnits().width() * length.viewportPercentageLength() / 100.0f); 136 return 0; 137 case ViewportPercentageHeight: 138 if (renderView) 139 return static_cast<int>(renderView->viewportSizeForCSSViewportUnits().height() * length.viewportPercentageLength() / 100.0f); 140 return 0; 141 case ViewportPercentageMin: 142 if (renderView) { 143 IntSize viewportSize = renderView->viewportSizeForCSSViewportUnits(); 144 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f); 145 } 146 return 0; 147 case ViewportPercentageMax: 148 if (renderView) { 149 IntSize viewportSize = renderView->viewportSizeForCSSViewportUnits(); 150 return static_cast<int>(std::max(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f); 151 } 152 return 0; 108 return length.nonNanCalculatedValue(maximumValue); 153 109 case Relative: 154 110 case Intrinsic: … … 165 121 } 166 122 167 float floatValueForLength(const Length& length, float maximumValue , RenderView* renderView)123 float floatValueForLength(const Length& length, float maximumValue) 168 124 { 169 125 switch (length.type()) { … … 177 133 case Calculated: 178 134 return length.nonNanCalculatedValue(maximumValue); 179 case ViewportPercentageWidth:180 if (renderView)181 return static_cast<int>(renderView->viewportSizeForCSSViewportUnits().width() * length.viewportPercentageLength() / 100.0f);182 return 0;183 case ViewportPercentageHeight:184 if (renderView)185 return static_cast<int>(renderView->viewportSizeForCSSViewportUnits().height() * length.viewportPercentageLength() / 100.0f);186 return 0;187 case ViewportPercentageMin:188 if (renderView) {189 IntSize viewportSize = renderView->viewportSizeForCSSViewportUnits();190 return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);191 }192 return 0;193 case ViewportPercentageMax:194 if (renderView) {195 IntSize viewportSize = renderView->viewportSizeForCSSViewportUnits();196 return static_cast<int>(std::max(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);197 }198 return 0;199 135 case Relative: 200 136 case Intrinsic: … … 211 147 } 212 148 213 FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatSize& boxSize , RenderView* view)149 FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatSize& boxSize) 214 150 { 215 return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width() , view), floatValueForLength(lengthSize.height(), boxSize.height(), view));151 return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width()), floatValueForLength(lengthSize.height(), boxSize.height())); 216 152 } 217 153 -
trunk/Source/WebCore/css/LengthFunctions.h
r168481 r169407 33 33 struct LengthSize; 34 34 35 int minimumIntValueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0,bool roundPercentages = false);36 int intValueForLength(const Length&, LayoutUnit maximumValue , RenderView* = 0, bool roundPercentages = false);37 LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0,bool roundPercentages = false);38 LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue , RenderView* = 0, bool roundPercentages = false);39 float floatValueForLength(const Length&, LayoutUnit maximumValue , RenderView* = 0);40 float floatValueForLength(const Length&, float maximumValue , RenderView* = 0);41 FloatSize floatSizeForLengthSize(const LengthSize&, const FloatSize& , RenderView* = 0);35 int minimumIntValueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false); 36 int intValueForLength(const Length&, LayoutUnit maximumValue); 37 LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false); 38 LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue); 39 float floatValueForLength(const Length&, LayoutUnit maximumValue); 40 float floatValueForLength(const Length&, float maximumValue); 41 FloatSize floatSizeForLengthSize(const LengthSize&, const FloatSize&); 42 42 43 43 } // namespace WebCore -
trunk/Source/WebCore/css/MediaQueryEvaluator.cpp
r167937 r169407 726 726 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 727 727 if (func) { 728 CSSToLengthConversionData conversionData(m_style.get(), m_frame->document()->documentElement()->renderStyle()); 728 CSSToLengthConversionData conversionData(m_style.get(), 729 m_frame->document()->documentElement()->renderStyle(), 730 m_frame->document()->renderView()); 729 731 return func(expr->value(), conversionData, m_frame, NoPrefix); 730 732 } -
trunk/Source/WebCore/css/StyleResolver.cpp
r169334 r169407 236 236 m_filtersWithPendingSVGDocuments.clear(); 237 237 #endif 238 m_cssToLengthConversionData = CSSToLengthConversionData( nullptr, nullptr);238 m_cssToLengthConversionData = CSSToLengthConversionData(); 239 239 } 240 240 … … 381 381 } 382 382 383 inline void StyleResolver::State::updateConversionData() 384 { 385 m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), m_rootElementStyle, m_element ? document().renderView() : nullptr); 386 } 387 383 388 inline void StyleResolver::State::initElement(Element* e) 384 389 { … … 386 391 m_styledElement = e && e->isStyledElement() ? toStyledElement(e) : nullptr; 387 392 m_elementLinkState = e ? e->document().visitedLinkState().determineLinkState(e) : NotInsideLink; 393 updateConversionData(); 388 394 } 389 395 … … 417 423 m_fontDirty = false; 418 424 419 m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), m_rootElementStyle); 425 updateConversionData(); 426 } 427 428 inline void StyleResolver::State::setStyle(PassRef<RenderStyle> style) 429 { 430 m_style = std::move(style); 431 updateConversionData(); 420 432 } 421 433 … … 796 808 adjustRenderStyle(*state.style(), *state.parentStyle(), element); 797 809 810 if (state.style()->hasViewportUnits()) 811 document().setHasStyleWithViewportUnits(); 812 798 813 state.clear(); // Clear out for the next resolve. 799 814 … … 964 979 // Clean up our style object's display and text decorations (among other fixups). 965 980 adjustRenderStyle(*state.style(), *m_state.parentStyle(), 0); 981 982 if (state.style()->hasViewportUnits()) 983 document().setHasStyleWithViewportUnits(); 966 984 967 985 // Start loading resources referenced by this style. … … 1393 1411 checkForOrientationChange(style); 1394 1412 style->font().update(m_fontSelector); 1413 if (m_state.fontSizeHasViewportUnits()) 1414 style->setHasViewportUnits(true); 1395 1415 m_state.setFontDirty(false); 1396 1416 } … … 1438 1458 Length StyleResolver::convertToIntLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData) 1439 1459 { 1440 return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion>(conversionData) : Length(Undefined);1460 return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | FractionConversion>(conversionData) : Length(Undefined); 1441 1461 } 1442 1462 1443 1463 Length StyleResolver::convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData) 1444 1464 { 1445 return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion>(conversionData) : Length(Undefined);1465 return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion>(conversionData) : Length(Undefined); 1446 1466 } 1447 1467 … … 1564 1584 { 1565 1585 m_matchedPropertiesCache.clear(); 1586 } 1587 1588 void StyleResolver::clearCachedPropertiesAffectedByViewportUnits() 1589 { 1590 Vector<unsigned, 16> toRemove; 1591 for (auto& cacheKeyValue : m_matchedPropertiesCache) { 1592 if (cacheKeyValue.value.renderStyle->hasViewportUnits()) 1593 toRemove.append(cacheKeyValue.key); 1594 } 1595 for (auto key : toRemove) 1596 m_matchedPropertiesCache.remove(key); 1566 1597 } 1567 1598 … … 1844 1875 } 1845 1876 1846 workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | ViewportPercentageConversion |CalculatedConversion | AutoConversion>(state.cssToLengthConversionData());1877 workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | AutoConversion>(state.cssToLengthConversionData()); 1847 1878 if (workingLength.length().isUndefined()) 1848 1879 return false; … … 2288 2319 CSSShadowValue* item = toCSSShadowValue(currValue); 2289 2320 int x = item->x->computeLength<int>(state.cssToLengthConversionData()); 2290 if (item->x->isViewportPercentageLength())2291 x = viewportPercentageValue(*item->x, x);2292 2321 int y = item->y->computeLength<int>(state.cssToLengthConversionData()); 2293 if (item->y->isViewportPercentageLength())2294 y = viewportPercentageValue(*item->y, y);2295 2322 int blur = item->blur ? item->blur->computeLength<int>(state.cssToLengthConversionData()) : 0; 2296 if (item->blur && item->blur->isViewportPercentageLength())2297 blur = viewportPercentageValue(*item->blur, blur);2298 2323 int spread = item->spread ? item->spread->computeLength<int>(state.cssToLengthConversionData()) : 0; 2299 if (item->spread && item->spread->isViewportPercentageLength())2300 spread = viewportPercentageValue(*item->spread, spread);2301 2324 ShadowStyle shadowStyle = item->style && item->style->getValueID() == CSSValueInset ? Inset : Normal; 2302 2325 Color color; … … 3237 3260 } 3238 3261 3239 bool StyleResolver:: affectedByViewportChange() const3262 bool StyleResolver::hasMediaQueriesAffectedByViewportChange() const 3240 3263 { 3241 3264 unsigned s = m_viewportDependentMediaQueryResults.size(); … … 3416 3439 CSSShadowValue* item = toCSSShadowValue(cssValue); 3417 3440 int x = item->x->computeLength<int>(state.cssToLengthConversionData()); 3418 if (item->x->isViewportPercentageLength())3419 x = viewportPercentageValue(*item->x, x);3420 3441 int y = item->y->computeLength<int>(state.cssToLengthConversionData()); 3421 if (item->y->isViewportPercentageLength())3422 y = viewportPercentageValue(*item->y, y);3423 3442 IntPoint location(x, y); 3424 3443 int blur = item->blur ? item->blur->computeLength<int>(state.cssToLengthConversionData()) : 0; 3425 if (item->blur && item->blur->isViewportPercentageLength())3426 blur = viewportPercentageValue(*item->blur, blur);3427 3444 Color color; 3428 3445 if (item->color) … … 3624 3641 } 3625 3642 3626 int StyleResolver::viewportPercentageValue(CSSPrimitiveValue& unit, int percentage)3627 {3628 int viewPortHeight = document().renderView()->viewportSizeForCSSViewportUnits().height() * percentage / 100.0f;3629 int viewPortWidth = document().renderView()->viewportSizeForCSSViewportUnits().width() * percentage / 100.0f;3630 3631 if (unit.isViewportPercentageHeight())3632 return viewPortHeight;3633 if (unit.isViewportPercentageWidth())3634 return viewPortWidth;3635 if (unit.isViewportPercentageMax())3636 return std::max(viewPortWidth, viewPortHeight);3637 if (unit.isViewportPercentageMin())3638 return std::min(viewPortWidth, viewPortHeight);3639 3640 ASSERT_NOT_REACHED();3641 return 0;3642 }3643 3644 3643 StyleResolver::CascadedProperties::CascadedProperties(TextDirection direction, WritingMode writingMode) 3645 3644 : m_direction(direction) -
trunk/Source/WebCore/css/StyleResolver.h
r167937 r169407 221 221 void addViewportDependentMediaQueryResult(const MediaQueryExp*, bool result); 222 222 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentMediaQueryResults.isEmpty(); } 223 bool affectedByViewportChange() const;223 bool hasMediaQueriesAffectedByViewportChange() const; 224 224 225 225 void addKeyframeStyle(PassRefPtr<StyleRuleKeyframes>); … … 233 233 void invalidateMatchedPropertiesCache(); 234 234 235 void clearCachedPropertiesAffectedByViewportUnits(); 236 235 237 #if ENABLE(CSS_FILTERS) 236 238 bool createFilterOperations(CSSValue* inValue, FilterOperations& outOperations); … … 239 241 240 242 void loadPendingResources(); 241 242 int viewportPercentageValue(CSSPrimitiveValue& unit, int percentage);243 243 244 244 struct RuleRange { … … 334 334 public: 335 335 State() 336 : m_element(0) 337 , m_styledElement(0) 338 , m_parentStyle(0) 339 , m_rootElementStyle(0) 340 , m_regionForStyling(0) 341 , m_elementLinkState(NotInsideLink) 342 , m_elementAffectedByClassRules(false) 343 , m_applyPropertyToRegularStyle(true) 344 , m_applyPropertyToVisitedLinkStyle(false) 345 , m_lineHeightValue(0) 346 , m_fontDirty(false) 347 , m_hasUAAppearance(false) 348 , m_backgroundData(BackgroundFillLayer) { } 336 : m_element(nullptr) 337 , m_styledElement(nullptr) 338 , m_parentStyle(nullptr) 339 , m_rootElementStyle(nullptr) 340 , m_regionForStyling(nullptr) 341 , m_elementLinkState(NotInsideLink) 342 , m_elementAffectedByClassRules(false) 343 , m_applyPropertyToRegularStyle(true) 344 , m_applyPropertyToVisitedLinkStyle(false) 345 , m_lineHeightValue(nullptr) 346 , m_fontDirty(false) 347 , m_fontSizeHasViewportUnits(false) 348 , m_hasUAAppearance(false) 349 , m_backgroundData(BackgroundFillLayer) 350 { 351 } 349 352 350 353 public: … … 356 359 Element* element() const { return m_element; } 357 360 StyledElement* styledElement() const { return m_styledElement; } 358 void setStyle(PassRef<RenderStyle> style) 359 { 360 m_style = std::move(style); 361 m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), m_rootElementStyle); 362 } 361 void setStyle(PassRef<RenderStyle>); 363 362 RenderStyle* style() const { return m_style.get(); } 364 363 PassRef<RenderStyle> takeStyle() { return m_style.releaseNonNull(); } … … 386 385 void setFontDirty(bool isDirty) { m_fontDirty = isDirty; } 387 386 bool fontDirty() const { return m_fontDirty; } 387 void setFontSizeHasViewportUnits(bool hasViewportUnits) { m_fontSizeHasViewportUnits = hasViewportUnits; } 388 bool fontSizeHasViewportUnits() const { return m_fontSizeHasViewportUnits; } 388 389 389 390 void cacheBorderAndBackground(); … … 406 407 407 408 private: 408 // FIXME(bug 108563): to make it easier to review, these member 409 // variables are public. However we should add methods to access 410 // these variables. 409 void updateConversionData(); 410 411 411 Element* m_element; 412 412 RefPtr<RenderStyle> m_style; … … 431 431 CSSValue* m_lineHeightValue; 432 432 bool m_fontDirty; 433 bool m_fontSizeHasViewportUnits; 433 434 434 435 bool m_hasUAAppearance; -
trunk/Source/WebCore/css/TransformFunctions.cpp
r167937 r169407 79 79 static Length convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData) 80 80 { 81 return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion>(conversionData) : Length(Undefined);81 return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion>(conversionData) : Length(Undefined); 82 82 } 83 83 -
trunk/Source/WebCore/dom/Document.cpp
r169244 r169407 115 115 #include "PopStateEvent.h" 116 116 #include "ProcessingInstruction.h" 117 #include "RenderChildIterator.h" 117 118 #include "RenderLayerCompositor.h" 118 119 #include "RenderView.h" … … 514 515 , m_hasInjectedPlugInsScript(false) 515 516 , m_renderTreeBeingDestroyed(false) 517 , m_hasStyleWithViewportUnits(false) 516 518 { 517 519 allDocuments().add(this); … … 1873 1875 { 1874 1876 RefPtr<RenderStyle> style = ensureStyleResolver().styleForPage(pageIndex); 1875 RenderView* view = renderView();1876 1877 1877 1878 int width = pageSize.width(); … … 1892 1893 ASSERT(size.width().isFixed()); 1893 1894 ASSERT(size.height().isFixed()); 1894 width = valueForLength(size.width(), 0 , view);1895 height = valueForLength(size.height(), 0 , view);1895 width = valueForLength(size.width(), 0); 1896 height = valueForLength(size.height(), 0); 1896 1897 break; 1897 1898 } … … 1903 1904 // The percentage is calculated with respect to the width even for margin top and bottom. 1904 1905 // http://www.w3.org/TR/CSS2/box.html#margin-properties 1905 marginTop = style->marginTop().isAuto() ? marginTop : intValueForLength(style->marginTop(), width , view);1906 marginRight = style->marginRight().isAuto() ? marginRight : intValueForLength(style->marginRight(), width , view);1907 marginBottom = style->marginBottom().isAuto() ? marginBottom : intValueForLength(style->marginBottom(), width , view);1908 marginLeft = style->marginLeft().isAuto() ? marginLeft : intValueForLength(style->marginLeft(), width , view);1906 marginTop = style->marginTop().isAuto() ? marginTop : intValueForLength(style->marginTop(), width); 1907 marginRight = style->marginRight().isAuto() ? marginRight : intValueForLength(style->marginRight(), width); 1908 marginBottom = style->marginBottom().isAuto() ? marginBottom : intValueForLength(style->marginBottom(), width); 1909 marginLeft = style->marginLeft().isAuto() ? marginLeft : intValueForLength(style->marginLeft(), width); 1909 1910 } 1910 1911 … … 3173 3174 } 3174 3175 3176 void Document::updateViewportUnitsOnResize() 3177 { 3178 if (!hasStyleWithViewportUnits()) 3179 return; 3180 3181 ensureStyleResolver().clearCachedPropertiesAffectedByViewportUnits(); 3182 3183 // FIXME: Ideally, we should save the list of elements that have viewport units and only iterate over those. 3184 for (Element* element = ElementTraversal::firstWithin(&rootNode()); element; element = ElementTraversal::nextIncludingPseudo(element)) { 3185 auto* renderer = element->renderer(); 3186 if (renderer && renderer->style().hasViewportUnits()) 3187 element->setNeedsStyleRecalc(InlineStyleChange); 3188 } 3189 } 3190 3175 3191 void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag) 3176 3192 { -
trunk/Source/WebCore/dom/Document.h
r169244 r169407 1274 1274 #endif 1275 1275 1276 void setHasStyleWithViewportUnits() { m_hasStyleWithViewportUnits = true; } 1277 bool hasStyleWithViewportUnits() const { return m_hasStyleWithViewportUnits; } 1278 void updateViewportUnitsOnResize(); 1279 1276 1280 protected: 1277 1281 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; … … 1692 1696 bool m_hasInjectedPlugInsScript; 1693 1697 bool m_renderTreeBeingDestroyed; 1698 1699 bool m_hasStyleWithViewportUnits; 1694 1700 }; 1695 1701 -
trunk/Source/WebCore/html/HTMLAreaElement.cpp
r166491 r169407 144 144 145 145 Path path; 146 RenderView* renderView = document().renderView();147 146 switch (shape) { 148 147 case Poly: 149 148 if (m_coordsLen >= 6) { 150 149 int numPoints = m_coordsLen / 2; 151 path.moveTo(FloatPoint(minimumValueForLength(m_coords[0], width , renderView), minimumValueForLength(m_coords[1], height, renderView)));150 path.moveTo(FloatPoint(minimumValueForLength(m_coords[0], width), minimumValueForLength(m_coords[1], height))); 152 151 for (int i = 1; i < numPoints; ++i) 153 path.addLineTo(FloatPoint(minimumValueForLength(m_coords[i * 2], width , renderView), minimumValueForLength(m_coords[i * 2 + 1], height, renderView)));152 path.addLineTo(FloatPoint(minimumValueForLength(m_coords[i * 2], width), minimumValueForLength(m_coords[i * 2 + 1], height))); 154 153 path.closeSubpath(); 155 154 } … … 158 157 if (m_coordsLen >= 3) { 159 158 Length radius = m_coords[2]; 160 int r = std::min(minimumValueForLength(radius, width , renderView), minimumValueForLength(radius, height, renderView));161 path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], width , renderView) - r, minimumValueForLength(m_coords[1], height, renderView) - r, 2 * r, 2 * r));159 int r = std::min(minimumValueForLength(radius, width), minimumValueForLength(radius, height)); 160 path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], width) - r, minimumValueForLength(m_coords[1], height) - r, 2 * r, 2 * r)); 162 161 } 163 162 break; 164 163 case Rect: 165 164 if (m_coordsLen >= 4) { 166 int x0 = minimumValueForLength(m_coords[0], width , renderView);167 int y0 = minimumValueForLength(m_coords[1], height , renderView);168 int x1 = minimumValueForLength(m_coords[2], width , renderView);169 int y1 = minimumValueForLength(m_coords[3], height , renderView);165 int x0 = minimumValueForLength(m_coords[0], width); 166 int y0 = minimumValueForLength(m_coords[1], height); 167 int x1 = minimumValueForLength(m_coords[2], width); 168 int y1 = minimumValueForLength(m_coords[3], height); 170 169 path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0)); 171 170 } -
trunk/Source/WebCore/page/FrameView.cpp
r169245 r169407 1145 1145 // Viewport-dependent media queries may cause us to need completely different style information. 1146 1146 StyleResolver* styleResolver = document.styleResolverIfExists(); 1147 if (!styleResolver || styleResolver-> affectedByViewportChange()) {1147 if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) { 1148 1148 document.styleResolverChanged(DeferRecalcStyle); 1149 1149 // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds. … … 1248 1248 else if (rootRenderer && rootRenderer->stretchesToViewport()) 1249 1249 rootRenderer->setChildNeedsLayout(); 1250 1251 document.updateViewportUnitsOnResize(); 1250 1252 } 1251 1253 } -
trunk/Source/WebCore/platform/Length.h
r167192 r169407 38 38 MinContent, MaxContent, FillAvailable, FitContent, 39 39 Calculated, 40 ViewportPercentageWidth, ViewportPercentageHeight, ViewportPercentageMin, ViewportPercentageMax,41 40 Undefined 42 41 }; 43 42 44 class CalculationValue; 45 43 class CalculationValue; 44 46 45 struct Length { 47 46 WTF_MAKE_FAST_ALLOCATED; … … 106 105 bool isSpecified() const; 107 106 bool isSpecifiedOrIntrinsic() const; 108 bool isViewportPercentage() const;109 107 110 108 // Blend two lengths to produce a new length that is in between them. Used for animation. … … 264 262 } 265 263 266 inline float Length::viewportPercentageLength() const267 {268 ASSERT(isViewportPercentage());269 return value();270 }271 272 264 inline LengthType Length::type() const 273 265 { … … 398 390 inline bool Length::isSpecified() const 399 391 { 400 return isFixed() || isPercent() || isViewportPercentage();392 return isFixed() || isPercent(); 401 393 } 402 394 … … 404 396 { 405 397 return isSpecified() || isIntrinsic(); 406 }407 408 inline bool Length::isViewportPercentage() const409 {410 return type() >= ViewportPercentageWidth && type() <= ViewportPercentageMax;411 398 } 412 399 -
trunk/Source/WebCore/rendering/ClipPathOperation.h
r168481 r169407 103 103 const BasicShape* basicShape() const { return m_shape.get(); } 104 104 WindRule windRule() const { return m_shape->windRule(); } 105 const Path pathForReferenceRect(const FloatRect& boundingRect , RenderView* view) const105 const Path pathForReferenceRect(const FloatRect& boundingRect) const 106 106 { 107 107 ASSERT(m_shape); 108 108 Path path; 109 m_shape->path(path, boundingRect , view);109 m_shape->path(path, boundingRect); 110 110 return path; 111 111 } … … 141 141 } 142 142 143 const Path pathForReferenceRect(const RoundedRect& boundingRect , RenderView*) const143 const Path pathForReferenceRect(const RoundedRect& boundingRect) const 144 144 { 145 145 Path path; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r169385 r169407 1240 1240 // FIXME: Technically percentage height objects only need a relayout if their percentage isn't going to be turned into 1241 1241 // an auto value. Add a method to determine this, so that we can avoid the relayout. 1242 if (relayoutChildren || (child.hasRelativeLogicalHeight() && !isRenderView()) || child.hasViewportPercentageLogicalHeight())1242 if (relayoutChildren || (child.hasRelativeLogicalHeight() && !isRenderView())) 1243 1243 child.setChildNeedsLayout(MarkOnlyThis); 1244 1244 … … 2542 2542 referenceBoxRect = borderBoxRect(); 2543 2543 } 2544 if (!clipPath->pathForReferenceRect(referenceBoxRect , &view()).contains(locationInContainer.point() - localOffset, clipPath->windRule()))2544 if (!clipPath->pathForReferenceRect(referenceBoxRect).contains(locationInContainer.point() - localOffset, clipPath->windRule())) 2545 2545 return false; 2546 2546 break; … … 2573 2573 LayoutRect borderRect = borderBoxRect(); 2574 2574 borderRect.moveBy(adjustedLocation); 2575 RoundedRect border = style().getRoundedBorderFor(borderRect , &view());2575 RoundedRect border = style().getRoundedBorderFor(borderRect); 2576 2576 if (!locationInContainer.intersects(border)) 2577 2577 return false; … … 3341 3341 RenderStyle& s = firstLine ? firstLineStyle() : style(); 3342 3342 if (&s != &style()) 3343 return s.computedLineHeight( &view());3343 return s.computedLineHeight(); 3344 3344 } 3345 3345 3346 3346 if (m_lineHeight == -1) 3347 m_lineHeight = style().computedLineHeight( &view());3347 m_lineHeight = style().computedLineHeight(); 3348 3348 3349 3349 return m_lineHeight; -
trunk/Source/WebCore/rendering/RenderBox.cpp
r169195 r169407 1243 1243 // into a transparency layer, and then clip that in one go (which requires setting up the clip before 1244 1244 // beginning the layer). 1245 RoundedRect border = style().getRoundedBorderFor(paintRect , &view());1245 RoundedRect border = style().getRoundedBorderFor(paintRect); 1246 1246 stateSaver.save(); 1247 1247 paintInfo.context->clipRoundedRect(FloatRoundedRect(border)); … … 2732 2732 if (height.isPercent()) 2733 2733 return computePercentageLogicalHeight(height); 2734 if (height.isViewportPercentage())2735 return valueForLength(height, 0);2736 2734 return -1; 2737 2735 } … … 2819 2817 availableHeight = std::max<LayoutUnit>(0, contentBoxHeight); 2820 2818 } 2821 } else if (cbstyle.logicalHeight().isViewportPercentage()) {2822 LayoutUnit heightWithScrollbar = valueForLength(cbstyle.logicalHeight(), 0);2823 if (heightWithScrollbar != -1) {2824 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar);2825 // We need to adjust for min/max height because this method does2826 // not handle the min/max of the current block, its caller does.2827 // So the return value from the recursive call will not have been2828 // adjusted yet.2829 LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight());2830 availableHeight = std::max<LayoutUnit>(0, contentBoxHeight);2831 }2832 2819 } else if (isOutOfFlowPositionedWithSpecifiedHeight) { 2833 2820 // Don't allow this to affect the block' height() member variable, since this … … 2879 2866 return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalWidth, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth(); 2880 2867 } 2881 case ViewportPercentageWidth:2882 case ViewportPercentageHeight:2883 case ViewportPercentageMin:2884 case ViewportPercentageMax:2885 return adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, 0));2886 2868 case FitContent: 2887 2869 case FillAvailable: … … 2977 2959 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, availableHeight)); 2978 2960 } 2979 case ViewportPercentageWidth:2980 case ViewportPercentageHeight:2981 case ViewportPercentageMin:2982 case ViewportPercentageMax:2983 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, 0));2984 2961 default: 2985 2962 return intrinsicLogicalHeight(); … … 4732 4709 } 4733 4710 4734 bool RenderBox::hasViewportPercentageLogicalHeight() const4735 {4736 return style().logicalHeight().isViewportPercentage()4737 || style().logicalMinHeight().isViewportPercentage()4738 || style().logicalMaxHeight().isViewportPercentage();4739 }4740 4741 4711 static void markBoxForRelayoutAfterSplit(RenderBox* box) 4742 4712 { -
trunk/Source/WebCore/rendering/RenderBox.h
r168993 r169407 571 571 virtual bool hasRelativeDimensions() const; 572 572 virtual bool hasRelativeLogicalHeight() const; 573 bool hasViewportPercentageLogicalHeight() const;574 573 575 574 bool hasHorizontalLayoutOverflow() const -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r169257 r169407 511 511 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const 512 512 { 513 RoundedRect border = style().getRoundedBorderFor(borderRect, &view(),includeLogicalLeftEdge, includeLogicalRightEdge);513 RoundedRect border = style().getRoundedBorderFor(borderRect, includeLogicalLeftEdge, includeLogicalRightEdge); 514 514 if (box && (box->nextLineBox() || box->prevLineBox())) { 515 RoundedRect segmentBorder = style().getRoundedBorderFor(LayoutRect(0, 0, inlineBoxWidth, inlineBoxHeight), &view(),includeLogicalLeftEdge, includeLogicalRightEdge);515 RoundedRect segmentBorder = style().getRoundedBorderFor(LayoutRect(0, 0, inlineBoxWidth, inlineBoxHeight), includeLogicalLeftEdge, includeLogicalRightEdge); 516 516 border.setRadii(segmentBorder.radii()); 517 517 } … … 953 953 if (layerWidth.isFixed()) 954 954 tileSize.setWidth(layerWidth.value()); 955 else if (layerWidth.isPercent() || layerWidth.isViewportPercentage())955 else if (layerWidth.isPercent()) 956 956 tileSize.setWidth(valueForLength(layerWidth, positioningAreaSize.width())); 957 957 958 958 if (layerHeight.isFixed()) 959 959 tileSize.setHeight(layerHeight.value()); 960 else if (layerHeight.isPercent() || layerHeight.isViewportPercentage())960 else if (layerHeight.isPercent()) 961 961 tileSize.setHeight(valueForLength(layerHeight, positioningAreaSize.height())); 962 962 … … 1229 1229 } 1230 1230 1231 static LayoutUnit computeBorderImageSide(Length borderSlice, LayoutUnit borderSide, LayoutUnit imageSide, LayoutUnit boxExtent , RenderView* renderView)1231 static LayoutUnit computeBorderImageSide(Length borderSlice, LayoutUnit borderSide, LayoutUnit imageSide, LayoutUnit boxExtent) 1232 1232 { 1233 1233 if (borderSlice.isRelative()) … … 1235 1235 if (borderSlice.isAuto()) 1236 1236 return imageSide; 1237 return valueForLength(borderSlice, boxExtent , renderView);1237 return valueForLength(borderSlice, boxExtent); 1238 1238 } 1239 1239 … … 1265 1265 LayoutUnit imageWidth = imageSize.width(); 1266 1266 LayoutUnit imageHeight = imageSize.height(); 1267 RenderView* renderView = &view();1268 1267 1269 1268 float imageScaleFactor = styleImage->imageScaleFactor(); … … 1276 1275 ENinePieceImageRule vRule = ninePieceImage.verticalRule(); 1277 1276 1278 LayoutUnit topWidth = computeBorderImageSide(ninePieceImage.borderSlices().top(), style.borderTopWidth(), topSlice, borderImageRect.height() , renderView);1279 LayoutUnit rightWidth = computeBorderImageSide(ninePieceImage.borderSlices().right(), style.borderRightWidth(), rightSlice, borderImageRect.width() , renderView);1280 LayoutUnit bottomWidth = computeBorderImageSide(ninePieceImage.borderSlices().bottom(), style.borderBottomWidth(), bottomSlice, borderImageRect.height() , renderView);1281 LayoutUnit leftWidth = computeBorderImageSide(ninePieceImage.borderSlices().left(), style.borderLeftWidth(), leftSlice, borderImageRect.width() , renderView);1282 1277 LayoutUnit topWidth = computeBorderImageSide(ninePieceImage.borderSlices().top(), style.borderTopWidth(), topSlice, borderImageRect.height()); 1278 LayoutUnit rightWidth = computeBorderImageSide(ninePieceImage.borderSlices().right(), style.borderRightWidth(), rightSlice, borderImageRect.width()); 1279 LayoutUnit bottomWidth = computeBorderImageSide(ninePieceImage.borderSlices().bottom(), style.borderBottomWidth(), bottomSlice, borderImageRect.height()); 1280 LayoutUnit leftWidth = computeBorderImageSide(ninePieceImage.borderSlices().left(), style.borderLeftWidth(), leftSlice, borderImageRect.width()); 1281 1283 1282 // Reduce the widths if they're too large. 1284 1283 // The spec says: Given Lwidth as the width of the border image area, Lheight as its height, and Wside as the border image width … … 1729 1728 BorderEdge edges[4]; 1730 1729 BorderEdge::getBorderEdgeInfo(edges, style, document().deviceScaleFactor(), includeLogicalLeftEdge, includeLogicalRightEdge); 1731 RoundedRect outerBorder = style.getRoundedBorderFor(rect, &view(),includeLogicalLeftEdge, includeLogicalRightEdge);1730 RoundedRect outerBorder = style.getRoundedBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge); 1732 1731 RoundedRect innerBorder = style.getRoundedInnerBorderFor(borderInnerRectAdjustedForBleedAvoidance(*graphicsContext, rect, bleedAvoidance), includeLogicalLeftEdge, includeLogicalRightEdge); 1733 1732 … … 2371 2370 2372 2371 RoundedRect border = (shadowStyle == Inset) ? style.getRoundedInnerBorderFor(paintRect, includeLogicalLeftEdge, includeLogicalRightEdge) 2373 : style.getRoundedBorderFor(paintRect, &view(),includeLogicalLeftEdge, includeLogicalRightEdge);2372 : style.getRoundedBorderFor(paintRect, includeLogicalLeftEdge, includeLogicalRightEdge); 2374 2373 2375 2374 bool hasBorderRadius = style.hasBorderRadius(); -
trunk/Source/WebCore/rendering/RenderElement.cpp
r169385 r169407 1245 1245 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit(); 1246 1246 LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min<LayoutUnit>(newBounds.width(), oldBounds.width())); 1247 LayoutUnit borderWidth = std::max<LayoutUnit>(borderRight, std::max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth , &view()), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));1247 LayoutUnit borderWidth = std::max<LayoutUnit>(borderRight, std::max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth), valueForLength(style().borderBottomRightRadius().width(), boxWidth))); 1248 1248 LayoutUnit decorationsWidth = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderWidth + minInsetRightShadowExtent) + std::max<LayoutUnit>(outlineWidth, shadowRight); 1249 1249 LayoutRect rightRect(newOutlineBox.x() + std::min(newOutlineBox.width(), oldOutlineBox.width()) - decorationsWidth, -
trunk/Source/WebCore/rendering/RenderElement.h
r169385 r169407 177 177 void propagateStyleToAnonymousChildren(StylePropagationType); 178 178 179 LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue , bool roundPercentages = false) const;179 LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue) const; 180 180 LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false) const; 181 181 … … 267 267 } 268 268 269 inline LayoutUnit RenderElement::valueForLength(const Length& length, LayoutUnit maximumValue , bool roundPercentages) const270 { 271 return WebCore::valueForLength(length, maximumValue , &view(), roundPercentages);269 inline LayoutUnit RenderElement::valueForLength(const Length& length, LayoutUnit maximumValue) const 270 { 271 return WebCore::valueForLength(length, maximumValue); 272 272 } 273 273 274 274 inline LayoutUnit RenderElement::minimumValueForLength(const Length& length, LayoutUnit maximumValue, bool roundPercentages) const 275 275 { 276 return WebCore::minimumValueForLength(length, maximumValue, &view(),roundPercentages);276 return WebCore::minimumValueForLength(length, maximumValue, roundPercentages); 277 277 } 278 278 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r169372 r169407 816 816 LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, sizingData.columnTracks); 817 817 LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChild(child, ForRows, sizingData.rowTracks); 818 if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || (oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight && (child->hasRelativeLogicalHeight() || child->hasViewportPercentageLogicalHeight())))818 if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || (oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight && child->hasRelativeLogicalHeight())) 819 819 child->setNeedsLayout(MarkOnlyThis); 820 820 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r168437 r169407 740 740 if (margin.isPercent()) 741 741 return minimumValueForLength(margin, std::max<LayoutUnit>(0, renderer->containingBlock()->availableLogicalWidth())); 742 if (margin.isViewportPercentage())743 return valueForLength(margin, 0, &renderer->view());744 742 return 0; 745 743 } … … 1400 1398 const RenderStyle& firstLineStyle = this->firstLineStyle(); 1401 1399 if (&firstLineStyle != &style()) 1402 return firstLineStyle.computedLineHeight( &view());1403 } 1404 1405 return style().computedLineHeight( &view());1400 return firstLineStyle.computedLineHeight(); 1401 } 1402 1403 return style().computedLineHeight(); 1406 1404 } 1407 1405 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r169402 r169407 3830 3830 LayoutRect referenceBox = computeReferenceBox(renderer(), clippingPath, offsetFromRoot, rootRelativeBounds); 3831 3831 context->save(); 3832 context->clipPath(clippingPath.pathForReferenceRect(referenceBox , &m_renderer.view()), clippingPath.windRule());3832 context->clipPath(clippingPath.pathForReferenceRect(referenceBox), clippingPath.windRule()); 3833 3833 return true; 3834 3834 } … … 3841 3841 3842 3842 context->save(); 3843 context->clipPath(clippingPath.pathForReferenceRect(shapeRect , &m_renderer.view()), RULE_NONZERO);3843 context->clipPath(clippingPath.pathForReferenceRect(shapeRect), RULE_NONZERO); 3844 3844 return true; 3845 3845 } -
trunk/Source/WebCore/rendering/RenderLineBreak.cpp
r168366 r169407 59 59 const RenderStyle& firstLineStyle = this->firstLineStyle(); 60 60 if (&firstLineStyle != &style()) 61 return firstLineStyle.computedLineHeight( &view());61 return firstLineStyle.computedLineHeight(); 62 62 } 63 63 64 64 if (m_cachedLineHeight == invalidLineHeight) 65 m_cachedLineHeight = style().computedLineHeight( &view());65 m_cachedLineHeight = style().computedLineHeight(); 66 66 67 67 return m_cachedLineHeight; -
trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp
r163973 r169407 80 80 } 81 81 82 static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength , RenderView* renderView)82 static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength) 83 83 { 84 84 if (!length.isIntrinsicOrAuto() || (sizeType == MinSize && length.isAuto())) 85 return minimumValueForLength(length, containingLength , renderView);85 return minimumValueForLength(length, containingLength); 86 86 return ScrollbarTheme::theme()->scrollbarThickness(); 87 87 } … … 91 91 if (!m_scrollbar->owningRenderer()) 92 92 return; 93 RenderView* renderView = &view();94 93 // FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change. 95 94 // FIXME: Querying the style's border information doesn't work on table cells with collapsing borders. 96 95 int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->style().borderLeftWidth() - m_scrollbar->owningRenderer()->style().borderRightWidth(); 97 int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style().width(), visibleSize , renderView);98 int minWidth = calcScrollbarThicknessUsing(MinSize, style().minWidth(), visibleSize , renderView);99 int maxWidth = style().maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style().maxWidth(), visibleSize , renderView);96 int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style().width(), visibleSize); 97 int minWidth = calcScrollbarThicknessUsing(MinSize, style().minWidth(), visibleSize); 98 int maxWidth = style().maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style().maxWidth(), visibleSize); 100 99 setWidth(std::max(minWidth, std::min(maxWidth, w))); 101 100 102 101 // Buttons and track pieces can all have margins along the axis of the scrollbar. 103 m_marginBox.setLeft(minimumValueForLength(style().marginLeft(), visibleSize , renderView));104 m_marginBox.setRight(minimumValueForLength(style().marginRight(), visibleSize , renderView));102 m_marginBox.setLeft(minimumValueForLength(style().marginLeft(), visibleSize)); 103 m_marginBox.setRight(minimumValueForLength(style().marginRight(), visibleSize)); 105 104 } 106 105 … … 109 108 if (!m_scrollbar->owningRenderer()) 110 109 return; 111 RenderView* renderView = &view();112 110 // FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change. 113 111 // FIXME: Querying the style's border information doesn't work on table cells with collapsing borders. 114 112 int visibleSize = m_scrollbar->owningRenderer()->height() - m_scrollbar->owningRenderer()->style().borderTopWidth() - m_scrollbar->owningRenderer()->style().borderBottomWidth(); 115 int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style().height(), visibleSize , renderView);116 int minHeight = calcScrollbarThicknessUsing(MinSize, style().minHeight(), visibleSize , renderView);117 int maxHeight = style().maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style().maxHeight(), visibleSize , renderView);113 int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style().height(), visibleSize); 114 int minHeight = calcScrollbarThicknessUsing(MinSize, style().minHeight(), visibleSize); 115 int maxHeight = style().maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style().maxHeight(), visibleSize); 118 116 setHeight(std::max(minHeight, std::min(maxHeight, h))); 119 117 120 118 // Buttons and track pieces can all have margins along the axis of the scrollbar. 121 m_marginBox.setTop(minimumValueForLength(style().marginTop(), visibleSize , renderView));122 m_marginBox.setBottom(minimumValueForLength(style().marginBottom(), visibleSize , renderView));119 m_marginBox.setTop(minimumValueForLength(style().marginTop(), visibleSize)); 120 m_marginBox.setBottom(minimumValueForLength(style().marginBottom(), visibleSize)); 123 121 } 124 122 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r168967 r169407 373 373 } else if (styleLogicalHeight.isPercent()) 374 374 computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeight); 375 else if (styleLogicalHeight.isViewportPercentage())376 computedLogicalHeight = minimumValueForLength(styleLogicalHeight, 0);377 375 else 378 376 ASSERT_NOT_REACHED(); … … 786 784 787 785 RenderStyle& styleToUse = style(); 788 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage , calc or viewport relativevalues for min-width.786 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for min-width. 789 787 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) { 790 788 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); … … 792 790 } 793 791 794 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage , calc or viewport relativevalues for maxWidth.792 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for maxWidth. 795 793 if (styleToUse.logicalMaxWidth().isFixed()) { 796 794 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value())); -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r169223 r169407 541 541 Document& document = element->document(); 542 542 RefPtr<CSSPrimitiveValue> emSize = CSSPrimitiveValue::create(0.5, CSSPrimitiveValue::CSS_EMS); 543 int pixels = emSize->computeLength<int>(CSSToLengthConversionData(style, document.renderStyle(), document. frame()->pageZoomFactor()));543 int pixels = emSize->computeLength<int>(CSSToLengthConversionData(style, document.renderStyle(), document.renderView(), document.frame()->pageZoomFactor())); 544 544 style->setPaddingBox(LengthBox(0, pixels, 0, pixels)); 545 545 } … … 947 947 // Set padding: 0 1.0em; on buttons. 948 948 // CSSPrimitiveValue::computeLengthInt only needs the element's style to calculate em lengths. 949 // Since the element might not be in a document, just pass nullptr for the root element style. 949 // Since the element might not be in a document, just pass nullptr for the root element style 950 // and the render view. 950 951 RefPtr<CSSPrimitiveValue> emSize = CSSPrimitiveValue::create(1.0, CSSPrimitiveValue::CSS_EMS); 951 int pixels = emSize->computeLength<int>(CSSToLengthConversionData(style, nullptr, 1.0, false));952 int pixels = emSize->computeLength<int>(CSSToLengthConversionData(style, nullptr, nullptr, 1.0, false)); 952 953 style->setPaddingBox(LengthBox(0, pixels, 0, pixels)); 953 954 -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r168870 r169407 1217 1217 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1218 1218 1219 FloatRoundedRect border = FloatRoundedRect(o.style().getRoundedBorderFor(r , &o.view()));1219 FloatRoundedRect border = FloatRoundedRect(o.style().getRoundedBorderFor(r)); 1220 1220 int radius = border.radii().topLeft().width(); 1221 1221 -
trunk/Source/WebCore/rendering/RenderView.cpp
r169245 r169407 331 331 for (auto& box : childrenOfType<RenderBox>(*this)) { 332 332 if (box.hasRelativeLogicalHeight() 333 || box.hasViewportPercentageLogicalHeight()334 333 || box.style().logicalHeight().isPercent() 335 334 || box.style().logicalMinHeight().isPercent() 336 335 || box.style().logicalMaxHeight().isPercent() 337 || box.style().logicalHeight().isViewportPercentage()338 || box.style().logicalMinHeight().isViewportPercentage()339 || box.style().logicalMaxHeight().isViewportPercentage()340 336 || box.isSVGRoot() 341 337 ) -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r168967 r169407 979 979 else 980 980 lineHeight = renderer->lineHeight(firstLine, lineDirection); 981 verticalPosition -= valueForLength(renderer->style().verticalAlignLength(), lineHeight , &renderer->view());981 verticalPosition -= valueForLength(renderer->style().verticalAlignLength(), lineHeight); 982 982 } 983 983 } -
trunk/Source/WebCore/rendering/shapes/Shape.cpp
r168481 r169407 91 91 } 92 92 93 std::unique_ptr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, float margin , RenderView* view)93 std::unique_ptr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, float margin) 94 94 { 95 95 ASSERT(basicShape); … … 104 104 case BasicShape::BasicShapeCircleType: { 105 105 const BasicShapeCircle* circle = static_cast<const BasicShapeCircle*>(basicShape); 106 float centerX = floatValueForCenterCoordinate(circle->centerX(), boxWidth , view);107 float centerY = floatValueForCenterCoordinate(circle->centerY(), boxHeight , view);108 float radius = circle->floatValueForRadiusInBox(boxWidth, boxHeight , view);106 float centerX = floatValueForCenterCoordinate(circle->centerX(), boxWidth); 107 float centerY = floatValueForCenterCoordinate(circle->centerY(), boxHeight); 108 float radius = circle->floatValueForRadiusInBox(boxWidth, boxHeight); 109 109 FloatPoint logicalCenter = physicalPointToLogical(FloatPoint(centerX, centerY), logicalBoxSize.height(), writingMode); 110 110 … … 115 115 case BasicShape::BasicShapeEllipseType: { 116 116 const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape); 117 float centerX = floatValueForCenterCoordinate(ellipse->centerX(), boxWidth , view);118 float centerY = floatValueForCenterCoordinate(ellipse->centerY(), boxHeight , view);119 float radiusX = ellipse->floatValueForRadiusInBox(ellipse->radiusX(), centerX, boxWidth , view);120 float radiusY = ellipse->floatValueForRadiusInBox(ellipse->radiusY(), centerY, boxHeight , view);117 float centerX = floatValueForCenterCoordinate(ellipse->centerX(), boxWidth); 118 float centerY = floatValueForCenterCoordinate(ellipse->centerY(), boxHeight); 119 float radiusX = ellipse->floatValueForRadiusInBox(ellipse->radiusX(), centerX, boxWidth); 120 float radiusY = ellipse->floatValueForRadiusInBox(ellipse->radiusY(), centerY, boxHeight); 121 121 FloatPoint logicalCenter = physicalPointToLogical(FloatPoint(centerX, centerY), logicalBoxSize.height(), writingMode); 122 122 … … 133 133 for (unsigned i = 0; i < valuesSize; i += 2) { 134 134 FloatPoint vertex( 135 floatValueForLength(values.at(i), boxWidth , view),136 floatValueForLength(values.at(i + 1), boxHeight , view));135 floatValueForLength(values.at(i), boxWidth), 136 floatValueForLength(values.at(i + 1), boxHeight)); 137 137 (*vertices)[i / 2] = physicalPointToLogical(vertex, logicalBoxSize.height(), writingMode); 138 138 } … … 144 144 case BasicShape::BasicShapeInsetType: { 145 145 const BasicShapeInset& inset = *static_cast<const BasicShapeInset*>(basicShape); 146 float left = floatValueForLength(inset.left(), boxWidth , view);147 float top = floatValueForLength(inset.top(), boxHeight , view);146 float left = floatValueForLength(inset.left(), boxWidth); 147 float top = floatValueForLength(inset.top(), boxHeight); 148 148 FloatRect rect(left, 149 149 top, 150 std::max<float>(boxWidth - left - floatValueForLength(inset.right(), boxWidth , view), 0),151 std::max<float>(boxHeight - top - floatValueForLength(inset.bottom(), boxHeight , view), 0));150 std::max<float>(boxWidth - left - floatValueForLength(inset.right(), boxWidth), 0), 151 std::max<float>(boxHeight - top - floatValueForLength(inset.bottom(), boxHeight), 0)); 152 152 FloatRect logicalRect = physicalRectToLogical(rect, logicalBoxSize.height(), writingMode); 153 153 154 154 FloatSize boxSize(boxWidth, boxHeight); 155 FloatSize topLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topLeftRadius(), boxSize , view), writingMode);156 FloatSize topRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topRightRadius(), boxSize , view), writingMode);157 FloatSize bottomLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomLeftRadius(), boxSize , view), writingMode);158 FloatSize bottomRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomRightRadius(), boxSize , view), writingMode);155 FloatSize topLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topLeftRadius(), boxSize), writingMode); 156 FloatSize topRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topRightRadius(), boxSize), writingMode); 157 FloatSize bottomLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomLeftRadius(), boxSize), writingMode); 158 FloatSize bottomRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomRightRadius(), boxSize), writingMode); 159 159 FloatRoundedRect::Radii cornerRadii(topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); 160 160 -
trunk/Source/WebCore/rendering/shapes/Shape.h
r168481 r169407 50 50 class BasicShape; 51 51 class Image; 52 class RenderView;53 52 class RoundedRect; 54 53 … … 68 67 }; 69 68 70 static std::unique_ptr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, float margin , RenderView*);69 static std::unique_ptr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, float margin); 71 70 static std::unique_ptr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& imageRect, const LayoutRect& marginRect, WritingMode, float margin); 72 71 static std::unique_ptr<Shape> createBoxShape(const RoundedRect&, WritingMode, float margin); -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
r168481 r169407 175 175 176 176 WritingMode writingMode = containingBlockStyle.writingMode(); 177 float margin = floatValueForLength(m_renderer.style().shapeMargin(), m_renderer.containingBlock() ? m_renderer.containingBlock()->contentWidth() : LayoutUnit() , &m_renderer.view());177 float margin = floatValueForLength(m_renderer.style().shapeMargin(), m_renderer.containingBlock() ? m_renderer.containingBlock()->contentWidth() : LayoutUnit()); 178 178 float shapeImageThreshold = style.shapeImageThreshold(); 179 179 const ShapeValue& shapeValue = *style.shapeOutside(); … … 182 182 case ShapeValue::Shape: 183 183 ASSERT(shapeValue.shape()); 184 m_shape = Shape::createShape(shapeValue.shape(), m_referenceBoxLogicalSize, writingMode, margin , &m_renderer.view());184 m_shape = Shape::createShape(shapeValue.shape(), m_referenceBoxLogicalSize, writingMode, margin); 185 185 break; 186 186 case ShapeValue::Image: { -
trunk/Source/WebCore/rendering/style/BasicShapes.cpp
r168481 r169407 89 89 } 90 90 91 float BasicShapeCircle::floatValueForRadiusInBox(float boxWidth, float boxHeight , RenderView* view) const91 float BasicShapeCircle::floatValueForRadiusInBox(float boxWidth, float boxHeight) const 92 92 { 93 93 if (m_radius.type() == BasicShapeRadius::Value) 94 94 return floatValueForLength(m_radius.value(), sqrtf((boxWidth * boxWidth + boxHeight * boxHeight) / 2)); 95 95 96 float centerX = floatValueForCenterCoordinate(m_centerX, boxWidth , view);97 float centerY = floatValueForCenterCoordinate(m_centerY, boxHeight , view);96 float centerX = floatValueForCenterCoordinate(m_centerX, boxWidth); 97 float centerY = floatValueForCenterCoordinate(m_centerY, boxHeight); 98 98 99 99 if (m_radius.type() == BasicShapeRadius::ClosestSide) … … 104 104 } 105 105 106 void BasicShapeCircle::path(Path& path, const FloatRect& boundingBox , RenderView* view)107 { 108 ASSERT(path.isEmpty()); 109 110 float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width() , view);111 float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height() , view);112 float radius = floatValueForRadiusInBox(boundingBox.width(), boundingBox.height() , view);106 void BasicShapeCircle::path(Path& path, const FloatRect& boundingBox) 107 { 108 ASSERT(path.isEmpty()); 109 110 float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width()); 111 float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height()); 112 float radius = floatValueForRadiusInBox(boundingBox.width(), boundingBox.height()); 113 113 path.addEllipse(FloatRect( 114 114 centerX - radius + boundingBox.x(), … … 131 131 } 132 132 133 float BasicShapeEllipse::floatValueForRadiusInBox(const BasicShapeRadius& radius, float center, float boxWidthOrHeight , RenderView* view) const133 float BasicShapeEllipse::floatValueForRadiusInBox(const BasicShapeRadius& radius, float center, float boxWidthOrHeight) const 134 134 { 135 135 if (radius.type() == BasicShapeRadius::Value) 136 return floatValueForLength(radius.value(), boxWidthOrHeight , view);136 return floatValueForLength(radius.value(), boxWidthOrHeight); 137 137 138 138 if (radius.type() == BasicShapeRadius::ClosestSide) … … 143 143 } 144 144 145 void BasicShapeEllipse::path(Path& path, const FloatRect& boundingBox , RenderView* view)146 { 147 ASSERT(path.isEmpty()); 148 149 float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width() , view);150 float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height() , view);151 float radiusX = floatValueForRadiusInBox(m_radiusX, centerX, boundingBox.width() , view);152 float radiusY = floatValueForRadiusInBox(m_radiusY, centerY, boundingBox.height() , view);145 void BasicShapeEllipse::path(Path& path, const FloatRect& boundingBox) 146 { 147 ASSERT(path.isEmpty()); 148 149 float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width()); 150 float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height()); 151 float radiusX = floatValueForRadiusInBox(m_radiusX, centerX, boundingBox.width()); 152 float radiusY = floatValueForRadiusInBox(m_radiusY, centerY, boundingBox.height()); 153 153 path.addEllipse(FloatRect( 154 154 centerX - radiusX + boundingBox.x(), … … 180 180 } 181 181 182 void BasicShapePolygon::path(Path& path, const FloatRect& boundingBox , RenderView* view)182 void BasicShapePolygon::path(Path& path, const FloatRect& boundingBox) 183 183 { 184 184 ASSERT(path.isEmpty()); … … 189 189 return; 190 190 191 path.moveTo(FloatPoint(floatValueForLength(m_values.at(0), boundingBox.width() , view) + boundingBox.x(),192 floatValueForLength(m_values.at(1), boundingBox.height() , view) + boundingBox.y()));191 path.moveTo(FloatPoint(floatValueForLength(m_values.at(0), boundingBox.width()) + boundingBox.x(), 192 floatValueForLength(m_values.at(1), boundingBox.height()) + boundingBox.y())); 193 193 for (size_t i = 2; i < length; i = i + 2) { 194 path.addLineTo(FloatPoint(floatValueForLength(m_values.at(i), boundingBox.width() , view) + boundingBox.x(),195 floatValueForLength(m_values.at(i + 1), boundingBox.height() , view) + boundingBox.y()));194 path.addLineTo(FloatPoint(floatValueForLength(m_values.at(i), boundingBox.width()) + boundingBox.x(), 195 floatValueForLength(m_values.at(i + 1), boundingBox.height()) + boundingBox.y())); 196 196 } 197 197 path.closeSubpath(); … … 221 221 } 222 222 223 static FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatRect& boundingBox , RenderView* view)224 { 225 return FloatSize(floatValueForLength(lengthSize.width(), boundingBox.width() , view),226 floatValueForLength(lengthSize.height(), boundingBox.height() , view));227 } 228 229 void BasicShapeInset::path(Path& path, const FloatRect& boundingBox , RenderView* view)230 { 231 ASSERT(path.isEmpty()); 232 float left = floatValueForLength(m_left, boundingBox.width() , view);233 float top = floatValueForLength(m_top, boundingBox.height() , view);223 static FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatRect& boundingBox) 224 { 225 return FloatSize(floatValueForLength(lengthSize.width(), boundingBox.width()), 226 floatValueForLength(lengthSize.height(), boundingBox.height())); 227 } 228 229 void BasicShapeInset::path(Path& path, const FloatRect& boundingBox) 230 { 231 ASSERT(path.isEmpty()); 232 float left = floatValueForLength(m_left, boundingBox.width()); 233 float top = floatValueForLength(m_top, boundingBox.height()); 234 234 FloatRoundedRect r = FloatRoundedRect( 235 235 FloatRect( 236 236 left + boundingBox.x(), 237 237 top + boundingBox.y(), 238 std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width() , view), 0),239 std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height() , view), 0)238 std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0), 239 std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0) 240 240 ), 241 floatSizeForLengthSize(m_topLeftRadius, boundingBox , view),242 floatSizeForLengthSize(m_topRightRadius, boundingBox , view),243 floatSizeForLengthSize(m_bottomLeftRadius, boundingBox , view),244 floatSizeForLengthSize(m_bottomRightRadius, boundingBox , view)241 floatSizeForLengthSize(m_topLeftRadius, boundingBox), 242 floatSizeForLengthSize(m_topRightRadius, boundingBox), 243 floatSizeForLengthSize(m_bottomLeftRadius, boundingBox), 244 floatSizeForLengthSize(m_bottomRightRadius, boundingBox) 245 245 ); 246 246 path.addRoundedRect(r); -
trunk/Source/WebCore/rendering/style/BasicShapes.h
r168481 r169407 44 44 class Path; 45 45 class RenderBox; 46 class RenderView;47 46 48 47 class BasicShape : public RefCounted<BasicShape> { … … 59 58 bool canBlend(const BasicShape*) const; 60 59 61 virtual void path(Path&, const FloatRect& , RenderView*) = 0;60 virtual void path(Path&, const FloatRect&) = 0; 62 61 virtual WindRule windRule() const { return RULE_NONZERO; } 63 62 virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const = 0; … … 153 152 const BasicShapeCenterCoordinate& centerY() const { return m_centerY; } 154 153 const BasicShapeRadius& radius() const { return m_radius; } 155 float floatValueForRadiusInBox(float boxWidth, float boxHeight , RenderView*) const;154 float floatValueForRadiusInBox(float boxWidth, float boxHeight) const; 156 155 157 156 void setCenterX(BasicShapeCenterCoordinate centerX) { m_centerX = std::move(centerX); } … … 159 158 void setRadius(BasicShapeRadius radius) { m_radius = std::move(radius); } 160 159 161 virtual void path(Path&, const FloatRect& , RenderView*) override;160 virtual void path(Path&, const FloatRect&) override; 162 161 virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override; 163 162 … … 179 178 const BasicShapeRadius& radiusX() const { return m_radiusX; } 180 179 const BasicShapeRadius& radiusY() const { return m_radiusY; } 181 float floatValueForRadiusInBox(const BasicShapeRadius&, float center, float boxWidthOrHeight , RenderView*) const;180 float floatValueForRadiusInBox(const BasicShapeRadius&, float center, float boxWidthOrHeight) const; 182 181 183 182 void setCenterX(BasicShapeCenterCoordinate centerX) { m_centerX = std::move(centerX); } … … 186 185 void setRadiusY(BasicShapeRadius radiusY) { m_radiusY = std::move(radiusY); } 187 186 188 virtual void path(Path&, const FloatRect& , RenderView*) override;187 virtual void path(Path&, const FloatRect&) override; 189 188 virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override; 190 189 … … 210 209 void appendPoint(Length x, Length y) { m_values.append(std::move(x)); m_values.append(std::move(y)); } 211 210 212 virtual void path(Path&, const FloatRect& , RenderView*) override;211 virtual void path(Path&, const FloatRect&) override; 213 212 virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override; 214 213 … … 249 248 void setBottomLeftRadius(LengthSize radius) { m_bottomLeftRadius = std::move(radius); } 250 249 251 virtual void path(Path&, const FloatRect& , RenderView*) override;250 virtual void path(Path&, const FloatRect&) override; 252 251 virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override; 253 252 -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r169089 r169407 1028 1028 } 1029 1029 1030 static RoundedRect::Radii calcRadiiFor(const BorderData& border, const LayoutSize& size , RenderView* renderView)1030 static RoundedRect::Radii calcRadiiFor(const BorderData& border, const LayoutSize& size) 1031 1031 { 1032 1032 return RoundedRect::Radii( 1033 LayoutSize(valueForLength(border.topLeft().width(), size.width() , renderView),1034 valueForLength(border.topLeft().height(), size.height() , renderView)),1035 LayoutSize(valueForLength(border.topRight().width(), size.width() , renderView),1036 valueForLength(border.topRight().height(), size.height() , renderView)),1037 LayoutSize(valueForLength(border.bottomLeft().width(), size.width() , renderView),1038 valueForLength(border.bottomLeft().height(), size.height() , renderView)),1039 LayoutSize(valueForLength(border.bottomRight().width(), size.width() , renderView),1040 valueForLength(border.bottomRight().height(), size.height() , renderView)));1033 LayoutSize(valueForLength(border.topLeft().width(), size.width()), 1034 valueForLength(border.topLeft().height(), size.height())), 1035 LayoutSize(valueForLength(border.topRight().width(), size.width()), 1036 valueForLength(border.topRight().height(), size.height())), 1037 LayoutSize(valueForLength(border.bottomLeft().width(), size.width()), 1038 valueForLength(border.bottomLeft().height(), size.height())), 1039 LayoutSize(valueForLength(border.bottomRight().width(), size.width()), 1040 valueForLength(border.bottomRight().height(), size.height()))); 1041 1041 } 1042 1042 … … 1058 1058 void RenderStyle::setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v); } 1059 1059 1060 RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, RenderView* renderView,bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const1060 RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const 1061 1061 { 1062 1062 RoundedRect roundedRect(borderRect); 1063 1063 if (hasBorderRadius()) { 1064 RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size() , renderView);1064 RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size()); 1065 1065 radii.scale(calcBorderRadiiConstraintScaleFor(borderRect, radii)); 1066 1066 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge); … … 1343 1343 void RenderStyle::setLineHeight(Length specifiedLineHeight) { SET_VAR(inherited, line_height, specifiedLineHeight); } 1344 1344 1345 int RenderStyle::computedLineHeight( RenderView* renderView) const1345 int RenderStyle::computedLineHeight() const 1346 1346 { 1347 1347 const Length& lh = lineHeight(); … … 1353 1353 if (lh.isPercent()) 1354 1354 return minimumValueForLength(lh, fontSize()); 1355 1356 if (lh.isViewportPercentage())1357 return valueForLength(lh, 0, renderView);1358 1355 1359 1356 return lh.value(); -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r169089 r169407 177 177 | pageBreakMask << pageBreakAfterOffset 178 178 | oneBitMask << explicitInheritanceOffset 179 | tableLayoutBitMask << tableLayoutOffset; 179 | tableLayoutBitMask << tableLayoutOffset 180 | hasViewportUnitsBitMask << hasViewportUnitsOffset; 180 181 181 182 m_flags = (m_flags & ~nonInheritedMask) | (other.m_flags & nonInheritedMask); … … 202 203 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(getValue(unicodeBidiMask, unicodeBidiOffset)); } 203 204 void setUnicodeBidi(EUnicodeBidi unicodeBidi) { updateValue(unicodeBidi, unicodeBidiMask, unicodeBidiOffset); } 205 206 bool hasViewportUnits() const { return getBoolean(hasViewportUnitsOffset); } 207 void setHasViewportUnits(bool value) { updateBoolean(value, hasViewportUnitsOffset); } 204 208 205 209 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(getValue(verticalAlignMask, verticalAlignOffset)); } … … 361 365 // Byte 6. 362 366 static const unsigned pseudoBitsBitCount = 7; 363 static const unsigned pseudoBitsPadding = 1; 364 static const unsigned pseudoBitsAndPaddingBitCount = pseudoBitsBitCount + pseudoBitsPadding; 365 static const uint64_t pseudoBitsMask = (oneBitMask << pseudoBitsAndPaddingBitCount) - 1; 366 static const unsigned pseudoBitsOffset = verticalAlignOffset + verticalAlignAndPaddingBitCount; 367 static const uint64_t pseudoBitsMask = (oneBitMask << pseudoBitsBitCount) - 1; 368 static const unsigned pseudoBitsOffset = verticalAlignOffset + verticalAlignBitCount; 369 370 static const unsigned hasViewportUnitsBitCount = 1; 371 static const uint64_t hasViewportUnitsBitMask = (oneBitMask << hasViewportUnitsBitCount) - 1; 372 static const unsigned hasViewportUnitsOffset = pseudoBitsOffset + pseudoBitsBitCount; 367 373 368 374 // Byte 7. … … 371 377 static const unsigned styleTypeAndPaddingBitCount = styleTypeBitCount + styleTypePadding; 372 378 static const uint64_t styleTypeMask = (oneBitMask << styleTypeAndPaddingBitCount) - 1; 373 static const unsigned styleTypeOffset = pseudoBitsOffset + pseudoBitsAndPaddingBitCount;379 static const unsigned styleTypeOffset = hasViewportUnitsBitCount + hasViewportUnitsOffset; 374 380 375 381 // Byte 8. … … 383 389 static const unsigned isLinkOffset = affectedByDragOffset + 1; 384 390 385 // Only 59 bits are assigned. There are 5 bits available currently used as padding to improve code generation. 391 392 // Only 60 bits are assigned. There are 4 bits available currently used as padding to improve code generation. 386 393 // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom(). 387 394 uint64_t m_flags; … … 471 478 472 479 // !END SYNC! 473 474 480 private: 475 481 // used to create the default style. … … 502 508 503 509 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); } 510 511 void setHasViewportUnits(bool hasViewportUnits = true) { noninherited_flags.setHasViewportUnits(hasViewportUnits); } 512 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits(); } 504 513 505 514 bool affectedByHover() const { return noninherited_flags.affectedByHover(); } … … 722 731 const Length& specifiedLineHeight() const; 723 732 Length lineHeight() const; 724 int computedLineHeight( RenderView* = 0) const;733 int computedLineHeight() const; 725 734 726 735 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); } … … 1223 1232 } 1224 1233 1225 RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, RenderView* = 0,bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;1234 RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; 1226 1235 RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; 1227 1236 -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r169385 r169407 118 118 } 119 119 120 static inline LayoutUnit resolveLengthAttributeForSVG(const Length& length, float scale, float maxSize , RenderView* renderView)121 { 122 return valueForLength(length, maxSize , renderView) * (length.isFixed() ? scale : 1);120 static inline LayoutUnit resolveLengthAttributeForSVG(const Length& length, float scale, float maxSize) 121 { 122 return valueForLength(length, maxSize) * (length.isFixed() ? scale : 1); 123 123 } 124 124 … … 136 136 137 137 if (svgSVGElement().hasIntrinsicWidth()) 138 return resolveLengthAttributeForSVG(svgSVGElement().intrinsicWidth(), style().effectiveZoom(), containingBlock()->availableLogicalWidth() , &view());138 return resolveLengthAttributeForSVG(svgSVGElement().intrinsicWidth(), style().effectiveZoom(), containingBlock()->availableLogicalWidth()); 139 139 140 140 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SVG. … … 155 155 156 156 if (svgSVGElement().hasIntrinsicHeight()) 157 return resolveLengthAttributeForSVG(svgSVGElement().intrinsicHeight(), style().effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding).toFloat() , &view());157 return resolveLengthAttributeForSVG(svgSVGElement().intrinsicHeight(), style().effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding).toFloat()); 158 158 159 159 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SVG. -
trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
r169368 r169407 154 154 } else 155 155 referenceBox = renderer.objectBoundingBox(); 156 m_paintInfo->context->clipPath(clipPath.pathForReferenceRect(referenceBox , &renderer.view()), clipPath.windRule());156 m_paintInfo->context->clipPath(clipPath.pathForReferenceRect(referenceBox), clipPath.windRule()); 157 157 } 158 158
Note:
See TracChangeset
for help on using the changeset viewer.