Changeset 68917 in webkit
- Timestamp:
- Oct 1, 2010 12:59:48 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68914 r68917 1 2010-10-01 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=46642, make replaced elements work with block-flow. This patch changes 6 all of the computeReplacedLogicalWidth and comuteReplacedLogicalHeight functions (and their helpers) to use logical width 7 and logical height instead. 8 9 Added fast/blockflow/block-level-images.html 10 11 * fast/blockflow/block-level-images.html: Added. 12 * fast/blockflow/resources: Added. 13 * fast/blockflow/resources/circle.svg: Added. 14 * fast/blockflow/resources/oval.png: Added. 15 * platform/mac/fast/blockflow/block-level-images-expected.checksum: Added. 16 * platform/mac/fast/blockflow/block-level-images-expected.png: Added. 17 * platform/mac/fast/blockflow/block-level-images-expected.txt: Added. 18 1 19 2010-09-30 Adam Barth <abarth@webkit.org> 2 20 -
trunk/WebCore/ChangeLog
r68916 r68917 1 2010-10-01 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=46642, make replaced elements work with block-flow. This patch changes 6 all of the computeReplacedLogicalWidth and comuteReplacedLogicalHeight functions (and their helpers) to use logical width 7 and logical height instead. 8 9 Added fast/blockflow/block-level-images.html 10 11 * rendering/RenderBox.cpp: 12 (WebCore::RenderBox::computeLogicalWidth): 13 (WebCore::RenderBox::computeLogicalHeight): 14 (WebCore::RenderBox::computeReplacedLogicalWidth): 15 (WebCore::RenderBox::computeReplacedLogicalWidthUsing): 16 (WebCore::RenderBox::computeReplacedLogicalHeight): 17 (WebCore::RenderBox::computeReplacedLogicalHeightUsing): 18 (WebCore::RenderBox::computePositionedLogicalWidthReplaced): 19 (WebCore::RenderBox::computePositionedLogicalHeightReplaced): 20 * rendering/RenderBox.h: 21 (WebCore::RenderBox::intrinsicLogicalWidth): 22 (WebCore::RenderBox::intrinsicLogicalHeight): 23 * rendering/RenderImage.cpp: 24 (WebCore::RenderImage::isLogicalWidthSpecified): 25 (WebCore::RenderImage::isLogicalHeightSpecified): 26 (WebCore::RenderImage::computeReplacedLogicalWidth): 27 (WebCore::RenderImage::computeReplacedLogicalHeight): 28 (WebCore::RenderImage::calcAspectRatioLogicalWidth): 29 (WebCore::RenderImage::calcAspectRatioLogicalHeight): 30 * rendering/RenderImage.h: 31 * rendering/RenderReplaced.cpp: 32 (WebCore::RenderReplaced::layout): 33 (WebCore::RenderReplaced::computeReplacedLogicalWidth): 34 (WebCore::RenderReplaced::computeReplacedLogicalHeight): 35 (WebCore::RenderReplaced::calcAspectRatioLogicalWidth): 36 (WebCore::RenderReplaced::calcAspectRatioLogicalHeight): 37 (WebCore::RenderReplaced::computePreferredLogicalWidths): 38 * rendering/RenderReplaced.h: 39 * rendering/RenderSVGRoot.cpp: 40 (WebCore::RenderSVGRoot::computePreferredLogicalWidths): 41 (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): 42 (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): 43 * rendering/RenderSVGRoot.h: 44 * rendering/RenderVideo.cpp: 45 (WebCore::RenderVideo::computeReplacedLogicalWidth): 46 (WebCore::RenderVideo::computeReplacedLogicalHeight): 47 * rendering/RenderVideo.h: 48 1 49 2010-10-01 Nate Chapin <japhet@chromium.org> 2 50 -
trunk/WebCore/rendering/RenderBox.cpp
r68897 r68917 1440 1440 bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching); 1441 1441 1442 Length logicalWidthLength = (treatAsReplaced) ? Length(computeReplaced Width(), Fixed) : style()->logicalWidth();1442 Length logicalWidthLength = (treatAsReplaced) ? Length(computeReplacedLogicalWidth(), Fixed) : style()->logicalWidth(); 1443 1443 1444 1444 RenderBlock* cb = containingBlock(); … … 1646 1646 h = Length(overrideSize() - borderAndPaddingLogicalHeight(), Fixed); 1647 1647 else if (treatAsReplaced) 1648 h = Length(computeReplaced Height(), Fixed);1648 h = Length(computeReplacedLogicalHeight(), Fixed); 1649 1649 else { 1650 1650 h = style()->logicalHeight(); … … 1811 1811 } 1812 1812 1813 int RenderBox::computeReplaced Width(bool includeMaxWidth) const1814 { 1815 int width = computeReplacedWidthUsing(style()->width());1816 int min W = computeReplacedWidthUsing(style()->minWidth());1817 int max W = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : computeReplacedWidthUsing(style()->maxWidth());1818 1819 return max(min W, min(width, maxW));1820 } 1821 1822 int RenderBox::computeReplaced WidthUsing(Length width) const1823 { 1824 switch ( width.type()) {1813 int RenderBox::computeReplacedLogicalWidth(bool includeMaxWidth) const 1814 { 1815 int logicalWidth = computeReplacedLogicalWidthUsing(style()->logicalWidth()); 1816 int minLogicalWidth = computeReplacedLogicalWidthUsing(style()->logicalMinWidth()); 1817 int maxLogicalWidth = !includeMaxWidth || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth()); 1818 1819 return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth)); 1820 } 1821 1822 int RenderBox::computeReplacedLogicalWidthUsing(Length logicalWidth) const 1823 { 1824 switch (logicalWidth.type()) { 1825 1825 case Fixed: 1826 return computeContentBoxLogicalWidth( width.value());1826 return computeContentBoxLogicalWidth(logicalWidth.value()); 1827 1827 case Percent: { 1828 1828 // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the … … 1831 1831 const int cw = isPositioned() ? containingBlockWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent(); 1832 1832 if (cw > 0) 1833 return computeContentBoxLogicalWidth( width.calcMinValue(cw));1833 return computeContentBoxLogicalWidth(logicalWidth.calcMinValue(cw)); 1834 1834 } 1835 1835 // fall through 1836 1836 default: 1837 return intrinsic Size().width();1837 return intrinsicLogicalWidth(); 1838 1838 } 1839 1839 } 1840 1840 1841 int RenderBox::computeReplaced Height() const1842 { 1843 int height = computeReplacedHeightUsing(style()->height());1844 int min H = computeReplacedHeightUsing(style()->minHeight());1845 int max H = style()->maxHeight().isUndefined() ? height : computeReplacedHeightUsing(style()->maxHeight());1846 1847 return max(min H, min(height, maxH));1848 } 1849 1850 int RenderBox::computeReplaced HeightUsing(Length height) const1851 { 1852 switch ( height.type()) {1841 int RenderBox::computeReplacedLogicalHeight() const 1842 { 1843 int logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight()); 1844 int minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight()); 1845 int maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight()); 1846 1847 return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight)); 1848 } 1849 1850 int RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) const 1851 { 1852 switch (logicalHeight.type()) { 1853 1853 case Fixed: 1854 return computeContentBoxLogicalHeight( height.value());1854 return computeContentBoxLogicalHeight(logicalHeight.value()); 1855 1855 case Percent: 1856 1856 { … … 1861 1861 } 1862 1862 1863 // FIXME: This calculation is not patched for block-flow yet. 1864 // https://bugs.webkit.org/show_bug.cgi?id=46500 1863 1865 if (cb->isPositioned() && cb->style()->height().isAuto() && !(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { 1864 1866 ASSERT(cb->isRenderBlock()); … … 1868 1870 int newHeight = block->computeContentBoxLogicalHeight(block->contentHeight()); 1869 1871 block->setHeight(oldHeight); 1870 return computeContentBoxLogicalHeight( height.calcValue(newHeight));1872 return computeContentBoxLogicalHeight(logicalHeight.calcValue(newHeight)); 1871 1873 } 1872 1874 1875 // FIXME: availableLogicalHeight() is wrong if the replaced element's block-flow is perpendicular to the 1876 // containing block's block-flow. 1877 // https://bugs.webkit.org/show_bug.cgi?id=46496 1873 1878 int availableHeight = isPositioned() ? containingBlockHeightForPositioned(toRenderBoxModelObject(cb)) : toRenderBox(cb)->availableLogicalHeight(); 1874 1879 … … 1876 1881 // box model. This is essential for sizing inside 1877 1882 // table cells using percentage heights. 1878 if (cb->isTableCell() && (cb->style()->height().isAuto() || cb->style()->height().isPercent())) { 1883 // FIXME: This needs to be made block-flow-aware. If the cell and image are perpendicular block-flows, this isn't right. 1884 // https://bugs.webkit.org/show_bug.cgi?id=46997 1885 if (cb->isTableCell() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) { 1879 1886 // Don't let table cells squeeze percent-height replaced elements 1880 1887 // <http://bugs.webkit.org/show_bug.cgi?id=15359> 1881 availableHeight = max(availableHeight, intrinsic Size().height());1882 return height.calcValue(availableHeight - borderAndPaddingHeight());1888 availableHeight = max(availableHeight, intrinsicLogicalHeight()); 1889 return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight()); 1883 1890 } 1884 1891 1885 return computeContentBoxLogicalHeight( height.calcValue(availableHeight));1892 return computeContentBoxLogicalHeight(logicalHeight.calcValue(availableHeight)); 1886 1893 } 1887 1894 default: 1888 return intrinsic Size().height();1895 return intrinsicLogicalHeight(); 1889 1896 } 1890 1897 } … … 2579 2586 // are dealt with in computeReplacedWidth(). This means that the steps to produce 2580 2587 // correct max/min in the non-replaced version, are not necessary. 2581 setWidth(computeReplaced Width() + borderAndPaddingWidth());2588 setWidth(computeReplacedLogicalWidth() + borderAndPaddingWidth()); 2582 2589 const int availableSpace = containerWidth - width(); 2583 2590 … … 2752 2759 // are dealt with in computeReplacedHeight(). This means that the steps to produce 2753 2760 // correct max/min in the non-replaced version, are not necessary. 2754 setHeight(computeReplaced Height() + borderAndPaddingHeight());2761 setHeight(computeReplacedLogicalHeight() + borderAndPaddingHeight()); 2755 2762 const int availableSpace = containerHeight - height(); 2756 2763 -
trunk/WebCore/rendering/RenderBox.h
r68842 r68917 277 277 278 278 virtual IntSize intrinsicSize() const { return IntSize(); } 279 int intrinsicLogicalWidth() const { return style()->isVerticalBlockFlow() ? intrinsicSize().width() : intrinsicSize().height(); } 280 int intrinsicLogicalHeight() const { return style()->isVerticalBlockFlow() ? intrinsicSize().height() : intrinsicSize().width(); } 279 281 280 282 // Whether or not the element shrinks to its intrinsic width (rather than filling the width … … 285 287 int computeLogicalWidthUsing(LogicalWidthType, int availableLogicalWidth); 286 288 int computeLogicalHeightUsing(const Length& height); 287 int computeReplaced WidthUsing(Length width) const;288 int computeReplaced HeightUsing(Length height) const;289 290 virtual int computeReplaced Width(bool includeMaxWidth = true) const;291 virtual int computeReplaced Height() const;289 int computeReplacedLogicalWidthUsing(Length width) const; 290 int computeReplacedLogicalHeightUsing(Length height) const; 291 292 virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const; 293 virtual int computeReplacedLogicalHeight() const; 292 294 293 295 int computePercentageLogicalHeight(const Length& height); -
trunk/WebCore/rendering/RenderImage.cpp
r68475 r68917 396 396 } 397 397 398 bool RenderImage::is WidthSpecified() const399 { 400 switch (style()-> width().type()) {398 bool RenderImage::isLogicalWidthSpecified() const 399 { 400 switch (style()->logicalWidth().type()) { 401 401 case Fixed: 402 402 case Percent: … … 413 413 } 414 414 415 bool RenderImage::is HeightSpecified() const416 { 417 switch (style()-> height().type()) {415 bool RenderImage::isLogicalHeightSpecified() const 416 { 417 switch (style()->logicalHeight().type()) { 418 418 case Fixed: 419 419 case Percent: … … 430 430 } 431 431 432 int RenderImage::computeReplaced Width(bool includeMaxWidth) const432 int RenderImage::computeReplacedLogicalWidth(bool includeMaxWidth) const 433 433 { 434 434 if (m_imageResource->imageHasRelativeWidth()) … … 438 438 } 439 439 440 int width; 441 if (isWidthSpecified()) 442 width = computeReplacedWidthUsing(style()->width()); 443 else if (m_imageResource->usesImageContainerSize()) 444 width = m_imageResource->imageSize(style()->effectiveZoom()).width(); 445 else if (m_imageResource->imageHasRelativeWidth()) 446 width = 0; // If the image is relatively-sized, set the width to 0 until there is a set container size. 440 int logicalWidth; 441 if (isLogicalWidthSpecified()) 442 logicalWidth = computeReplacedLogicalWidthUsing(style()->logicalWidth()); 443 else if (m_imageResource->usesImageContainerSize()) { 444 IntSize size = m_imageResource->imageSize(style()->effectiveZoom()); 445 logicalWidth = style()->isVerticalBlockFlow() ? size.width() : size.height(); 446 } else if (m_imageResource->imageHasRelativeWidth()) 447 logicalWidth = 0; // If the image is relatively-sized, set the width to 0 until there is a set container size. 447 448 else 448 width = calcAspectRatioWidth(); 449 450 int minW = computeReplacedWidthUsing(style()->minWidth()); 451 int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : computeReplacedWidthUsing(style()->maxWidth()); 452 453 return max(minW, min(width, maxW)); 454 } 455 456 int RenderImage::computeReplacedHeight() const 457 { 458 int height; 459 if (isHeightSpecified()) 460 height = computeReplacedHeightUsing(style()->height()); 461 else if (m_imageResource->usesImageContainerSize()) 462 height = m_imageResource->imageSize(style()->effectiveZoom()).height(); 463 else if (m_imageResource->imageHasRelativeHeight()) 464 height = 0; // If the image is relatively-sized, set the height to 0 until there is a set container size. 449 logicalWidth = calcAspectRatioLogicalWidth(); 450 451 int minLogicalWidth = computeReplacedLogicalWidthUsing(style()->logicalMinWidth()); 452 int maxLogicalWidth = !includeMaxWidth || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth()); 453 454 return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth)); 455 } 456 457 int RenderImage::computeReplacedLogicalHeight() const 458 { 459 int logicalHeight; 460 if (isLogicalHeightSpecified()) 461 logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight()); 462 else if (m_imageResource->usesImageContainerSize()) { 463 IntSize size = m_imageResource->imageSize(style()->effectiveZoom()); 464 logicalHeight = style()->isVerticalBlockFlow() ? size.height() : size.width(); 465 } else if (m_imageResource->imageHasRelativeHeight()) 466 logicalHeight = 0; // If the image is relatively-sized, set the height to 0 until there is a set container size. 465 467 else 466 height = calcAspectRatioHeight(); 467 468 int minH = computeReplacedHeightUsing(style()->minHeight()); 469 int maxH = style()->maxHeight().isUndefined() ? height : computeReplacedHeightUsing(style()->maxHeight()); 470 471 return max(minH, min(height, maxH)); 472 } 473 474 int RenderImage::calcAspectRatioWidth() const 475 { 476 IntSize size = intrinsicSize(); 477 if (!size.height()) 468 logicalHeight = calcAspectRatioLogicalHeight(); 469 470 int minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight()); 471 int maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight()); 472 473 return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight)); 474 } 475 476 int RenderImage::calcAspectRatioLogicalWidth() const 477 { 478 int intrinsicWidth = intrinsicLogicalWidth(); 479 int intrinsicHeight = intrinsicLogicalHeight(); 480 if (!intrinsicHeight) 478 481 return 0; 479 482 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) 480 return size.width(); // Don't bother scaling. 481 return RenderBox::computeReplacedHeight() * size.width() / size.height(); 482 } 483 484 int RenderImage::calcAspectRatioHeight() const 485 { 486 IntSize size = intrinsicSize(); 487 if (!size.width()) 483 return intrinsicWidth; // Don't bother scaling. 484 return RenderBox::computeReplacedLogicalHeight() * intrinsicWidth / intrinsicHeight; 485 } 486 487 int RenderImage::calcAspectRatioLogicalHeight() const 488 { 489 int intrinsicWidth = intrinsicLogicalWidth(); 490 int intrinsicHeight = intrinsicLogicalHeight(); 491 if (!intrinsicWidth) 488 492 return 0; 489 493 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) 490 return size.height(); // Don't bother scaling.491 return RenderBox::computeReplaced Width() * size.height() / size.width();494 return intrinsicHeight; // Don't bother scaling. 495 return RenderBox::computeReplacedLogicalWidth() * intrinsicHeight / intrinsicWidth; 492 496 } 493 497 -
trunk/WebCore/rendering/RenderImage.h
r68239 r68917 59 59 virtual void paint(PaintInfo&, int tx, int ty); 60 60 61 bool is WidthSpecified() const;62 bool is HeightSpecified() const;61 bool isLogicalWidthSpecified() const; 62 bool isLogicalHeightSpecified() const; 63 63 64 64 virtual void intrinsicSizeChanged() … … 81 81 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); 82 82 83 virtual int computeReplaced Width(bool includeMaxWidth = true) const;84 virtual int computeReplaced Height() const;83 virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const; 84 virtual int computeReplacedLogicalHeight() const; 85 85 86 int calcAspectRatio Width() const;87 int calcAspectRatio Height() const;86 int calcAspectRatioLogicalWidth() const; 87 int calcAspectRatioLogicalHeight() const; 88 88 89 89 private: -
trunk/WebCore/rendering/RenderReplaced.cpp
r68276 r68917 58 58 } 59 59 60 void RenderReplaced::setStyle(PassRefPtr<RenderStyle> newStyle)61 {62 if (newStyle->blockFlow() != TopToBottomBlockFlow)63 newStyle->setBlockFlow(TopToBottomBlockFlow);64 RenderBox::setStyle(newStyle);65 }66 67 60 void RenderReplaced::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 68 61 { … … 89 82 addShadowOverflow(); 90 83 91 repainter.repaintAfterLayout(); 92 84 repainter.repaintAfterLayout(); 93 85 setNeedsLayout(false); 94 86 } … … 208 200 } 209 201 210 int RenderReplaced::computeReplaced Width(bool includeMaxWidth) const211 { 212 int width;202 int RenderReplaced::computeReplacedLogicalWidth(bool includeMaxWidth) const 203 { 204 int logicalWidth; 213 205 if (lengthIsSpecified(style()->width())) 214 width = computeReplacedWidthUsing(style()->width());206 logicalWidth = computeReplacedLogicalWidthUsing(style()->logicalWidth()); 215 207 else if (m_hasIntrinsicSize) 216 width = calcAspectRatioWidth();208 logicalWidth = calcAspectRatioLogicalWidth(); 217 209 else 218 width = intrinsicSize().width();219 220 int min W = computeReplacedWidthUsing(style()->minWidth());221 int max W = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : computeReplacedWidthUsing(style()->maxWidth());222 223 return max(min W, min(width, maxW));224 } 225 226 int RenderReplaced::computeReplaced Height() const227 { 228 int height;229 if (lengthIsSpecified(style()-> height()))230 height = computeReplacedHeightUsing(style()->height());210 logicalWidth = intrinsicLogicalWidth(); 211 212 int minLogicalWidth = computeReplacedLogicalWidthUsing(style()->logicalMinWidth()); 213 int maxLogicalWidth = !includeMaxWidth || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth()); 214 215 return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth)); 216 } 217 218 int RenderReplaced::computeReplacedLogicalHeight() const 219 { 220 int logicalHeight; 221 if (lengthIsSpecified(style()->logicalHeight())) 222 logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight()); 231 223 else if (m_hasIntrinsicSize) 232 height = calcAspectRatioHeight();224 logicalHeight = calcAspectRatioLogicalHeight(); 233 225 else 234 height = intrinsicSize().height();235 236 int min H = computeReplacedHeightUsing(style()->minHeight());237 int max H = style()->maxHeight().isUndefined() ? height : computeReplacedHeightUsing(style()->maxHeight());238 239 return max(min H, min(height, maxH));240 } 241 242 int RenderReplaced::calcAspectRatio Width() const243 { 244 int intrinsicWidth = intrinsic Size().width();245 int intrinsicHeight = intrinsic Size().height();226 logicalHeight = intrinsicLogicalHeight(); 227 228 int minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight()); 229 int maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight()); 230 231 return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight)); 232 } 233 234 int RenderReplaced::calcAspectRatioLogicalWidth() const 235 { 236 int intrinsicWidth = intrinsicLogicalWidth(); 237 int intrinsicHeight = intrinsicLogicalHeight(); 246 238 if (!intrinsicHeight) 247 239 return 0; 248 return RenderBox::computeReplaced Height() * intrinsicWidth / intrinsicHeight;249 } 250 251 int RenderReplaced::calcAspectRatio Height() const252 { 253 int intrinsicWidth = intrinsic Size().width();254 int intrinsicHeight = intrinsic Size().height();240 return RenderBox::computeReplacedLogicalHeight() * intrinsicWidth / intrinsicHeight; 241 } 242 243 int RenderReplaced::calcAspectRatioLogicalHeight() const 244 { 245 int intrinsicWidth = intrinsicLogicalWidth(); 246 int intrinsicHeight = intrinsicLogicalHeight(); 255 247 if (!intrinsicWidth) 256 248 return 0; 257 return RenderBox::computeReplaced Width() * intrinsicHeight / intrinsicWidth;249 return RenderBox::computeReplacedLogicalWidth() * intrinsicHeight / intrinsicWidth; 258 250 } 259 251 … … 263 255 264 256 int borderAndPadding = borderAndPaddingWidth(); 265 m_maxPreferredLogicalWidth = computeReplaced Width(false) + borderAndPadding;257 m_maxPreferredLogicalWidth = computeReplacedLogicalWidth(false) + borderAndPadding; 266 258 267 259 if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) -
trunk/WebCore/rendering/RenderReplaced.h
r68276 r68917 33 33 virtual ~RenderReplaced(); 34 34 35 virtual void setStyle(PassRefPtr<RenderStyle>);36 37 35 protected: 38 36 virtual void layout(); … … 40 38 virtual IntSize intrinsicSize() const; 41 39 42 virtual int computeReplaced Width(bool includeMaxWidth = true) const;43 virtual int computeReplaced Height() const;40 virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const; 41 virtual int computeReplacedLogicalHeight() const; 44 42 virtual int minimumReplacedHeight() const { return 0; } 45 43 … … 68 66 virtual void computePreferredLogicalWidths(); 69 67 70 int calcAspectRatio Width() const;71 int calcAspectRatio Height() const;68 int calcAspectRatioLogicalWidth() const; 69 int calcAspectRatioLogicalHeight() const; 72 70 73 71 virtual void paintReplaced(PaintInfo&, int /*tx*/, int /*ty*/) { } -
trunk/WebCore/rendering/RenderSVGRoot.cpp
r68444 r68917 69 69 70 70 int borderAndPadding = borderAndPaddingWidth(); 71 int width = computeReplaced Width(false) + borderAndPadding;71 int width = computeReplacedLogicalWidth(false) + borderAndPadding; 72 72 73 73 if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) … … 83 83 } 84 84 85 int RenderSVGRoot::computeReplaced Width(bool includeMaxWidth) const86 { 87 int replacedWidth = RenderBox::computeReplaced Width(includeMaxWidth);88 if (!style()-> width().isPercent())85 int RenderSVGRoot::computeReplacedLogicalWidth(bool includeMaxWidth) const 86 { 87 int replacedWidth = RenderBox::computeReplacedLogicalWidth(includeMaxWidth); 88 if (!style()->logicalWidth().isPercent()) 89 89 return replacedWidth; 90 90 … … 94 94 } 95 95 96 int RenderSVGRoot::computeReplaced Height() const97 { 98 int replacedHeight = RenderBox::computeReplaced Height();99 if (!style()-> height().isPercent())96 int RenderSVGRoot::computeReplacedLogicalHeight() const 97 { 98 int replacedHeight = RenderBox::computeReplacedLogicalHeight(); 99 if (!style()->logicalHeight().isPercent()) 100 100 return replacedHeight; 101 101 -
trunk/WebCore/rendering/RenderSVGRoot.h
r68276 r68917 55 55 virtual int baselinePosition(bool b, bool isRootLineBox = false) const; 56 56 virtual void computePreferredLogicalWidths(); 57 virtual int computeReplaced Width(bool includeMaxWidth = true) const;58 virtual int computeReplaced Height() const;57 virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const; 58 virtual int computeReplacedLogicalHeight() const; 59 59 virtual void layout(); 60 60 virtual void paint(PaintInfo&, int parentX, int parentY); -
trunk/WebCore/rendering/RenderVideo.cpp
r68276 r68917 247 247 } 248 248 249 int RenderVideo::computeReplaced Width(bool includeMaxWidth) const250 { 251 return RenderReplaced::computeReplaced Width(includeMaxWidth);252 } 253 254 int RenderVideo::computeReplaced Height() const255 { 256 return RenderReplaced::computeReplaced Height();249 int RenderVideo::computeReplacedLogicalWidth(bool includeMaxWidth) const 250 { 251 return RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth); 252 } 253 254 int RenderVideo::computeReplacedLogicalHeight() const 255 { 256 return RenderReplaced::computeReplacedLogicalHeight(); 257 257 } 258 258 -
trunk/WebCore/rendering/RenderVideo.h
r68239 r68917 71 71 virtual void layout(); 72 72 73 virtual int computeReplaced Width(bool includeMaxWidth = true) const;74 virtual int computeReplaced Height() const;73 virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const; 74 virtual int computeReplacedLogicalHeight() const; 75 75 virtual int minimumReplacedHeight() const; 76 76
Note: See TracChangeset
for help on using the changeset viewer.