Changeset 97378 in webkit


Ignore:
Timestamp:
Oct 13, 2011 12:04:43 PM (13 years ago)
Author:
robert@webkit.org
Message:

CSS 2.1 failure: inline-replaced-height-008.htm
https://bugs.webkit.org/show_bug.cgi?id=69273

Reviewed by Simon Fraser.

Source/WebCore:

Test: css2.1/20110323/inline-block-replaced-height-008.html

Per http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height, if 'height' has computed value of
'auto', the replaced element has an intrinsic ratio and its used width is known or resolved, then
the used value of 'height' is determined by the equation (used width) / (intrinsic ratio).

  • rendering/RenderImage.cpp:

(WebCore::RenderImage::computeReplacedLogicalHeight):

  • rendering/RenderReplaced.h:

LayoutTests:

  • css2.1/20110323/floating-replaced-height-008.htm: Added.
  • css2.1/20110323/inline-block-replaced-height-008.htm: Added.
  • css2.1/20110323/inline-replaced-height-008.htm: Added.
  • css2.1/20110323/support/60x60-green.png: Added
  • platform/chromium-linux/css2.1/20110323/floating-replaced-height-008-expected.png: Added.
  • platform/chromium-linux/css2.1/20110323/floating-replaced-height-008-expected.txt: Added.
  • platform/chromium-linux/css2.1/20110323/inline-block-replaced-height-008-expected.png: Added.
  • platform/chromium-linux/css2.1/20110323/inline-block-replaced-height-008-expected.txt: Added.
  • platform/chromium-linux/css2.1/20110323/inline-replaced-height-008-expected.png: Added.
  • platform/chromium-linux/css2.1/20110323/inline-replaced-height-008-expected.txt: Added.
Location:
trunk
Files:
11 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r97377 r97378  
     12011-10-03  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: inline-replaced-height-008.htm
     4        https://bugs.webkit.org/show_bug.cgi?id=69273
     5
     6        Reviewed by Simon Fraser.
     7
     8        * css2.1/20110323/floating-replaced-height-008.htm: Added.
     9        * css2.1/20110323/inline-block-replaced-height-008.htm: Added.
     10        * css2.1/20110323/inline-replaced-height-008.htm: Added.
     11        * css2.1/20110323/support/60x60-green.png: Added
     12        * platform/chromium-linux/css2.1/20110323/floating-replaced-height-008-expected.png: Added.
     13        * platform/chromium-linux/css2.1/20110323/floating-replaced-height-008-expected.txt: Added.
     14        * platform/chromium-linux/css2.1/20110323/inline-block-replaced-height-008-expected.png: Added.
     15        * platform/chromium-linux/css2.1/20110323/inline-block-replaced-height-008-expected.txt: Added.
     16        * platform/chromium-linux/css2.1/20110323/inline-replaced-height-008-expected.png: Added.
     17        * platform/chromium-linux/css2.1/20110323/inline-replaced-height-008-expected.txt: Added.
     18
    1192011-10-13  Adam Klein  <adamk@chromium.org>
    220
  • trunk/Source/WebCore/ChangeLog

    r97372 r97378  
     12011-10-03  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: inline-replaced-height-008.htm
     4        https://bugs.webkit.org/show_bug.cgi?id=69273
     5
     6        Reviewed by Simon Fraser.
     7
     8        Test: css2.1/20110323/inline-block-replaced-height-008.html
     9
     10        Per http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height,  if 'height' has computed value of
     11        'auto', the replaced element has an intrinsic ratio and its used width is known or resolved, then
     12        the used value of 'height' is determined by the equation (used width) / (intrinsic ratio).
     13
     14        * rendering/RenderImage.cpp:
     15        (WebCore::RenderImage::computeReplacedLogicalHeight):
     16        * rendering/RenderReplaced.h:
     17
    1182011-10-13  Sheriff Bot  <webkit.review.bot@gmail.com>
    219
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r95697 r97378  
    538538LayoutUnit RenderImage::computeReplacedLogicalHeight() const
    539539{
     540    // FIXME: This function should use RenderReplaced::computeReplacedLogicalHeight()
    540541    LayoutUnit logicalHeight;
    541     if (isLogicalHeightSpecified())
     542    if (logicalHeightIsAuto() && !style()->logicalWidth().isAuto() && intrinsicLogicalWidth() && intrinsicLogicalHeight())
     543        logicalHeight = static_cast<LayoutUnit>(availableLogicalWidth() * intrinsicLogicalHeight() / intrinsicLogicalWidth());
     544    else if (isLogicalHeightSpecified())
    542545        logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight());
    543546    else if (m_imageResource->usesImageContainerSize()) {
  • trunk/Source/WebCore/rendering/RenderReplaced.h

    r96187 r97378  
    3636    virtual LayoutUnit computeReplacedLogicalHeight() const;
    3737
     38    bool logicalHeightIsAuto() const;
     39
    3840protected:
    3941    virtual void willBeDestroyed();
     
    6365    int computeIntrinsicLogicalWidth(RenderBox* contentRenderer, bool includeMaxWidth) const;
    6466    int computeIntrinsicLogicalHeight(RenderBox* contentRenderer) const;
    65     bool logicalHeightIsAuto() const;
    6667
    6768    virtual const char* renderName() const { return "RenderReplaced"; }
Note: See TracChangeset for help on using the changeset viewer.