Changeset 123031 in webkit


Ignore:
Timestamp:
Jul 18, 2012 3:28:21 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Content size of child having percent height inside a fixed height container having overflow:auto is wrongly calculated
https://bugs.webkit.org/show_bug.cgi?id=11355

Patch by Pravin D <pravind.2k4@gmail.com> on 2012-07-18
Reviewed by Julien Chaffraix.

Source/WebCore:

The content height of a child must be container height minus padding, border width and height of horizontal scrollbar(if any).

Tests: fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto.html

fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
Subtracting the height of the scrollbar from the client height when the client has percentage height.

LayoutTests:

  • fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto-expected.txt: Added.
  • fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto.html: Added.
  • fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto-expected.txt: Added.
  • fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123028 r123031  
     12012-07-18  Pravin D  <pravind.2k4@gmail.com>
     2
     3        Content size of child having percent height inside a fixed height container having overflow:auto is wrongly calculated
     4        https://bugs.webkit.org/show_bug.cgi?id=11355
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        * fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto-expected.txt: Added.
     9        * fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto.html: Added.
     10        * fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto-expected.txt: Added.
     11        * fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto.html: Added.
     12
    1132012-07-18  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r123029 r123031  
     12012-07-18  Pravin D  <pravind.2k4@gmail.com>
     2
     3        Content size of child having percent height inside a fixed height container having overflow:auto is wrongly calculated
     4        https://bugs.webkit.org/show_bug.cgi?id=11355
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        The content height of a child must be container height minus padding, border width and height of horizontal scrollbar(if any).
     9
     10        Tests: fast/overflow/child-100percent-height-inside-fixed-container-with-overflow-auto.html
     11               fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto.html
     12
     13        * rendering/RenderBox.cpp:
     14        (WebCore::RenderBox::computePercentageLogicalHeight):
     15        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
     16        Subtracting the height of the scrollbar from the client height when the client has percentage height.
     17
    1182012-07-18  Anantanarayanan G Iyengar  <ananta@chromium.org>
    219
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r123025 r123031  
    21242124            includeBorderPadding = true;
    21252125        }
    2126     }
    2127     // Otherwise we only use our percentage height if our containing block had a specified
    2128     // height.
    2129     else if (cbstyle->logicalHeight().isFixed())
    2130         result = cb->computeContentBoxLogicalHeight(cbstyle->logicalHeight().value());
    2131     else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
     2126    } else if (cbstyle->logicalHeight().isFixed()) {
     2127        // Otherwise we only use our percentage height if our containing block had a specified height.
     2128        LayoutUnit contentBoxHeightWithScrollbar = cb->computeContentBoxLogicalHeight(cbstyle->logicalHeight().value());
     2129        result = max<LayoutUnit>(0, contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight());
     2130    } else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
    21322131        // We need to recur and compute the percentage height for our containing block.
    21332132        result = cb->computePercentageLogicalHeight(cbstyle->logicalHeight());
     
    22662265                }
    22672266            }
    2268             return computeContentBoxLogicalHeight(valueForLength(logicalHeight, availableHeight));
     2267            availableHeight = computeContentBoxLogicalHeight(valueForLength(logicalHeight, availableHeight));
     2268            if (cb->style()->logicalHeight().isFixed())
     2269                availableHeight = max<LayoutUnit>(0, availableHeight - toRenderBox(cb)->scrollbarLogicalHeight());
     2270            return availableHeight;
    22692271        }
    22702272        case ViewportPercentageWidth:
Note: See TracChangeset for help on using the changeset viewer.