Changeset 135741 in webkit


Ignore:
Timestamp:
Nov 26, 2012, 11:07:20 AM (12 years ago)
Author:
jchaffraix@webkit.org
Message:

RenderBox::computePercentageLogicalHeight should use containingBlockLogicalWidthForContent
https://bugs.webkit.org/show_bug.cgi?id=103075

Reviewed by Ojan Vafai.

Source/WebCore:

Using the containing block's content logical block was working for most renderers but 2 renderers
were special and were broken in orthogonal writing modes:

  • captions as they override containingBlockLogicalWidthForContent to return the table's logical width.
  • multi-column renderers as they override availableLogicalWidth to constrain the child to the column logical width.

By switching to containingBlockLogicalWidthForContent, we got those 2 cases covered.

Tests: fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html

fast/table/caption-orthogonal-writing-mode-sizing.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computePercentageLogicalHeight):
Updated the function to track which renderer's containing block we use and call
containingBlockLogicalWidthForContent on it.

LayoutTests:

  • fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode-expected.txt: Added.
  • fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html: Added.
  • fast/table/caption-orthogonal-writing-mode-sizing-expected.txt: Added.
  • fast/table/caption-orthogonal-writing-mode-sizing.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r135740 r135741  
     12012-11-26  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        RenderBox::computePercentageLogicalHeight should use containingBlockLogicalWidthForContent
     4        https://bugs.webkit.org/show_bug.cgi?id=103075
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode-expected.txt: Added.
     9        * fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html: Added.
     10        * fast/table/caption-orthogonal-writing-mode-sizing-expected.txt: Added.
     11        * fast/table/caption-orthogonal-writing-mode-sizing.html: Added.
     12
    1132012-11-26  Abhishek Arya  <inferno@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r135740 r135741  
     12012-11-26  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        RenderBox::computePercentageLogicalHeight should use containingBlockLogicalWidthForContent
     4        https://bugs.webkit.org/show_bug.cgi?id=103075
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Using the containing block's content logical block was working for most renderers but 2 renderers
     9        were special and were broken in orthogonal writing modes:
     10        - captions as they override containingBlockLogicalWidthForContent to return the table's logical width.
     11        - multi-column renderers as they override availableLogicalWidth to constrain the child to the column logical width.
     12
     13        By switching to containingBlockLogicalWidthForContent, we got those 2 cases covered.
     14
     15        Tests: fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html
     16               fast/table/caption-orthogonal-writing-mode-sizing.html
     17
     18        * rendering/RenderBox.cpp:
     19        (WebCore::RenderBox::computePercentageLogicalHeight):
     20        Updated the function to track which renderer's containing block we use and call
     21        containingBlockLogicalWidthForContent on it.
     22
    1232012-11-26  Abhishek Arya  <inferno@chromium.org>
    224
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r135629 r135741  
    21952195    bool skippedAutoHeightContainingBlock = false;
    21962196    RenderBlock* cb = containingBlock();
     2197    const RenderBox* containingBlockChild = this;
    21972198    LayoutUnit rootMarginBorderPaddingHeight = 0;
    21982199    while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation(cb)) {
     
    22002201            rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfter() + cb->borderAndPaddingLogicalHeight();
    22012202        skippedAutoHeightContainingBlock = true;
     2203        containingBlockChild = cb;
    22022204        cb = cb->containingBlock();
    22032205        cb->addPercentHeightDescendant(const_cast<RenderBox*>(this));
     
    22152217
    22162218    if (isHorizontalWritingMode() != cb->isHorizontalWritingMode())
    2217         availableHeight = cb->contentLogicalWidth();
     2219        availableHeight = containingBlockChild->containingBlockLogicalWidthForContent();
    22182220    else if (cb->isTableCell()) {
    22192221        if (!skippedAutoHeightContainingBlock) {
Note: See TracChangeset for help on using the changeset viewer.