Changeset 91242 in webkit
- Timestamp:
- Jul 19, 2011 1:12:46 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r91238 r91242 1 2011-07-19 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 REGRESSION (r88913): Preview in Safari's snippet editor has a fixed height instead of filling the entire pane 4 https://bugs.webkit.org/show_bug.cgi?id=64059 5 6 REGRESSION (r88913): <object> has wrong computed height 7 https://bugs.webkit.org/show_bug.cgi?id=62769 8 9 Reviewed by Rob Buis. 10 11 Add new layout test in fast/css covering both bugs. 12 Update svg/zoom/page results (this is a progression, but the test itself remains broken, see comment inline). 13 14 * fast/css/replaced-element-implicit-size.html: Added. 15 * platform/mac/fast/css/replaced-element-implicit-size-expected.png: Added. 16 * platform/mac/fast/css/replaced-element-implicit-size-expected.txt: Added. 17 * platform/mac/svg/zoom/page/zoom-svg-through-object-with-text-expected.png: 18 * platform/mac/svg/zoom/page/zoom-svg-through-object-with-text-expected.txt: 19 1 20 2011-07-18 Ryosuke Niwa <rniwa@webkit.org> 2 21 -
trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-text-expected.txt
r87526 r91242 8 8 RenderView at (0,0) size 59x13 9 9 layer at (0,0) size 59x13 10 RenderSVGRoot {svg} at (0,0) size 59x1311 RenderSVGPath {rect} at (0,0) size 59x13[fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=59.00] [height=13.00]12 RenderSVGPath {circle} at (2 5,2) size 9x9 [fill={[type=SOLID] [color=#0000FF]}] [cx=29.50] [cy=6.50] [r=4.27]13 RenderSVGText {text} at (5, 2) size 29x18contains 1 chunk(s)14 RenderSVGInlineText {#text} at (0,0) size 29x1815 chunk 1 text run 1 at (5.00,16.00) startOffset 0 endOffset 4 width 29.00: "Text"10 RenderSVGRoot {svg} at (0,0) size 49x13 11 RenderSVGPath {rect} at (0,0) size 49x12 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=59.00] [height=13.00] 12 RenderSVGPath {circle} at (20,1) size 9x9 [fill={[type=SOLID] [color=#0000FF]}] [cx=29.50] [cy=6.50] [r=4.27] 13 RenderSVGText {text} at (5,1) size 31x19 contains 1 chunk(s) 14 RenderSVGInlineText {#text} at (0,0) size 31x19 15 chunk 1 text run 1 at (5.00,16.00) startOffset 0 endOffset 4 width 30.24: "Text" 16 16 RenderText {#text} at (0,0) size 0x0 17 17 RenderText {#text} at (0,0) size 0x0 -
trunk/Source/WebCore/ChangeLog
r91237 r91242 1 2011-07-19 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 REGRESSION (r88913): Preview in Safari's snippet editor has a fixed height instead of filling the entire pane 4 https://bugs.webkit.org/show_bug.cgi?id=64059 5 6 REGRESSION (r88913): <object> has wrong computed height 7 https://bugs.webkit.org/show_bug.cgi?id=62769 8 9 Reviewed by Rob Buis. 10 11 Fix misinterpretation of CSS 2.1 - "10.5 Content height: the 'height' property". 12 It says "If the height of the containing block is not specified explicitelz (i.e. it depends on the 13 content height), and this element is not absolutely positioned, the value computes to 'auto'". 14 15 Checking whether the containing block height depends on the content height is not equal to checking 16 whether the height property is set on the containing block, there are other ways to implicitly specify 17 the height by setting top & bottom. Fix that by checking whether the containing block has a height 18 property or top & bottom set. 19 20 While I was at it, make computeReplacedLogicalWidth/Height a bit more explicit to make it easier to compare 21 the code with the spec quoatations - this doesn't change the functionality only the readability. 22 23 Test: fast/css/replaced-element-implicit-size.html 24 25 * rendering/RenderReplaced.cpp: 26 (WebCore::RenderReplaced::computeReplacedLogicalWidth): Cleanup comment, make code more explicit. 27 (WebCore::RenderReplaced::logicalHeightIsAuto): Add helper method used by computeReplacedLogicalHeight. 28 (WebCore::RenderReplaced::computeReplacedLogicalHeight): Fix height=auto detection. 29 * rendering/RenderReplaced.h: 30 1 31 2011-07-18 Ryosuke Niwa <rniwa@webkit.org> 2 32 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r90833 r91242 298 298 if (hasIntrinsicWidth) 299 299 return computeIntrinsicLogicalWidth(contentRenderer, includeMaxWidth); 300 } 301 302 // Otherwise, if 'width' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'width' becomes 300px. If 300px is too 303 // wide to fit the device, UAs should use the width of the largest rectangle that has a 2:1 ratio and fits the device instead. 300 301 // Otherwise, if 'width' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'width' becomes 300px. If 300px is too 302 // wide to fit the device, UAs should use the width of the largest rectangle that has a 2:1 ratio and fits the device instead. 303 return computeReplacedLogicalWidthRespectingMinMaxWidth(cDefaultWidth, includeMaxWidth); 304 } 305 304 306 return computeReplacedLogicalWidthRespectingMinMaxWidth(intrinsicLogicalWidth(), includeMaxWidth); 305 307 } 306 308 309 bool RenderReplaced::logicalHeightIsAuto() const 310 { 311 Length logicalHeightLength = style()->logicalHeight(); 312 if (logicalHeightLength.isAuto()) 313 return true; 314 315 // For percentage heights: The percentage is calculated with respect to the height of the generated box's 316 // containing block. If the height of the containing block is not specified explicitly (i.e., it depends 317 // on content height), and this element is not absolutely positioned, the value computes to 'auto'. 318 if (!logicalHeightLength.isPercent() || isPositioned() || document()->inQuirksMode()) 319 return false; 320 321 for (RenderBlock* cb = containingBlock(); !cb->isRenderView(); cb = cb->containingBlock()) { 322 if (cb->isTableCell() || (!cb->style()->logicalHeight().isAuto() || (!cb->style()->top().isAuto() && !cb->style()->bottom().isAuto()))) 323 return false; 324 } 325 326 return true; 327 } 328 307 329 LayoutUnit RenderReplaced::computeReplacedLogicalHeight() const 308 330 { 309 331 // 10.5 Content height: the 'height' property: http://www.w3.org/TR/CSS21/visudet.html#propdef-height 310 // If the height of the containing block is not specified explicitly (i.e., it depends on 311 // content height), and this element is not absolutely positioned, the value computes to 'auto'. 312 bool heightIsAuto = style()->logicalHeight().isAuto(); 313 if (!document()->inQuirksMode() && !isPositioned() && style()->logicalHeight().isPercent()) { 314 if (RenderObject* containingBlock = this->containingBlock()) { 315 while (containingBlock->isAnonymous()) 316 containingBlock = containingBlock->containingBlock(); 317 heightIsAuto = !containingBlock->style()->logicalHeight().isSpecified(); 318 } 319 } 320 332 bool heightIsAuto = logicalHeightIsAuto(); 321 333 if (style()->logicalHeight().isSpecified() && !heightIsAuto) 322 334 return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight())); … … 351 363 if (hasIntrinsicHeight) 352 364 return computeIntrinsicLogicalHeight(contentRenderer); 353 } 354 355 // Otherwise, if 'height' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'height' must be set to the height 356 // of the largest rectangle that has a 2:1 ratio, has a height not greater than 150px, and has a width not greater than the device width. 365 366 // Otherwise, if 'height' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'height' must be set to the height 367 // of the largest rectangle that has a 2:1 ratio, has a height not greater than 150px, and has a width not greater than the device width. 368 return computeReplacedLogicalHeightRespectingMinMaxHeight(cDefaultHeight); 369 } 370 357 371 return computeReplacedLogicalHeightRespectingMinMaxHeight(intrinsicLogicalHeight()); 358 372 } -
trunk/Source/WebCore/rendering/RenderReplaced.h
r90675 r91242 63 63 int computeIntrinsicLogicalWidth(RenderBox* contentRenderer, bool includeMaxWidth) const; 64 64 int computeIntrinsicLogicalHeight(RenderBox* contentRenderer) const; 65 bool logicalHeightIsAuto() const; 65 66 66 67 virtual const char* renderName() const { return "RenderReplaced"; }
Note: See TracChangeset
for help on using the changeset viewer.