Changeset 122501 in webkit


Ignore:
Timestamp:
Jul 12, 2012 1:48:39 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Percentage width replaced element in zero percent/fixed width container block incorrectly rendered.
https://bugs.webkit.org/show_bug.cgi?id=9493

Patch by Pravin D <pravind.2k4@gmail.com> on 2012-07-12
Reviewed by Andy Estes.

Source/WebCore:

When the width of the container is zero percent/fixed value then the width of the replaced element must also be zero.

Test: fast/css/percent-width-img-inside-zero-percent-and-fixed-container.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeReplacedLogicalWidthUsing):

When the containing block's available width is zero there can be two cases.
The containing block is floated/positioned in which case the width of the replaced child element must be its instrinsic width.
On the other hand if the width of the container is specified to be either zero percent or fixed value then the width of the
replaced elment must be zero.

LayoutTests:

  • fast/css/percent-width-img-inside-zero-percent-and-fixed-container-expected.html: Added.
  • fast/css/percent-width-img-inside-zero-percent-and-fixed-container.html: Added.
  • fast/css/resources/red-box.png: Added. Image resource file for the test case.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122499 r122501  
     12012-07-12  Pravin D  <pravind.2k4@gmail.com>
     2
     3        Percentage width replaced element in zero percent/fixed width container block incorrectly rendered.
     4        https://bugs.webkit.org/show_bug.cgi?id=9493
     5
     6        Reviewed by Andy Estes.
     7
     8        * fast/css/percent-width-img-inside-zero-percent-and-fixed-container-expected.html: Added.
     9        * fast/css/percent-width-img-inside-zero-percent-and-fixed-container.html: Added.
     10        * fast/css/resources/red-box.png: Added.
     11          Image resource file for the test case.
     12
    1132012-07-12  Dirk Pranke  <dpranke@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r122498 r122501  
     12012-07-12  Pravin D  <pravind.2k4@gmail.com>
     2
     3        Percentage width replaced element in zero percent/fixed width container block incorrectly rendered.
     4        https://bugs.webkit.org/show_bug.cgi?id=9493
     5
     6        Reviewed by Andy Estes.
     7
     8        When the width of the container is zero percent/fixed value then the width of the replaced element must also be zero.
     9
     10        Test: fast/css/percent-width-img-inside-zero-percent-and-fixed-container.html
     11
     12        * rendering/RenderBox.cpp:
     13        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
     14          When the containing block's available width is zero there can be two cases.
     15          The containing block is floated/positioned in which case the width of the replaced child element must be its instrinsic width.
     16          On the other hand if the width of the container is specified to be either zero percent or fixed value then the width of the
     17          replaced elment must be zero.
     18
    1192012-07-11  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r122489 r122501  
    22062206            // https://bugs.webkit.org/show_bug.cgi?id=46496
    22072207            const LayoutUnit cw = isOutOfFlowPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent();
    2208             if (cw > 0)
     2208            Length containerLogicalWidth = containingBlock()->style()->logicalWidth();
     2209            // FIXME: Handle cases when containing block width is calculated or viewport percent.
     2210            // https://bugs.webkit.org/show_bug.cgi?id=91071
     2211            if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercent())))
    22092212                return computeContentBoxLogicalWidth(minimumValueForLength(logicalWidth, cw));
    22102213        }
Note: See TracChangeset for help on using the changeset viewer.