Changeset 41876 in webkit


Ignore:
Timestamp:
Mar 20, 2009 4:41:54 PM (15 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Dave Hyatt.

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::percentHeightDescendants): Added this accessor.
  • rendering/RenderBlock.h:
  • rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::layoutRows): Extended the check for children that flex to include other descendants with percent height which is relative to the cell.

LayoutTests:

Reviewed by Dave Hyatt.

  • fast/replaced/percent-height-in-anonymous-block-in-table.html: Added.
  • fast/replaced/table-percent-height-expected.txt:
  • fast/replaced/table-percent-height.html:
  • platform/mac/fast/replaced/percent-height-in-anonymous-block-in-table-expected.checksum: Added.
  • platform/mac/fast/replaced/percent-height-in-anonymous-block-in-table-expected.png: Added.
  • platform/mac/fast/replaced/percent-height-in-anonymous-block-in-table-expected.txt: Added.
Location:
trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r41875 r41876  
     12009-03-20  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        - test, updated test and results for https://bugs.webkit.org/show_bug.cgi?id=23739
     6          <rdar://problem/6556371> REGRESSION (r36513): iframe isn't sized properly upon load
     7
     8        * fast/replaced/percent-height-in-anonymous-block-in-table.html: Added.
     9        * fast/replaced/table-percent-height-expected.txt:
     10        * fast/replaced/table-percent-height.html:
     11        * platform/mac/fast/replaced/percent-height-in-anonymous-block-in-table-expected.checksum: Added.
     12        * platform/mac/fast/replaced/percent-height-in-anonymous-block-in-table-expected.png: Added.
     13        * platform/mac/fast/replaced/percent-height-in-anonymous-block-in-table-expected.txt: Added.
     14
    1152009-03-20  Dmitry Titov  <dimich@chromium.org>
    216
  • trunk/LayoutTests/fast/replaced/table-percent-height-expected.txt

    r29039 r41876  
    9393PASS getComputedStyleForElement(document.getElementById('input-text-100'), 'height') is '13px'
    9494PASS getComputedStyleForElement(document.getElementById('isindex-75'), 'width') is '142px'
    95 PASS getComputedStyleForElement(document.getElementById('isindex-75'), 'height') is '13px'
     95PASS getComputedStyleForElement(document.getElementById('isindex-75'), 'height') is '35px'
    9696PASS getComputedStyleForElement(document.getElementById('isindex-100'), 'width') is '142px'
    97 PASS getComputedStyleForElement(document.getElementById('isindex-100'), 'height') is '13px'
     97PASS getComputedStyleForElement(document.getElementById('isindex-100'), 'height') is '49px'
    9898PASS getComputedStyleForElement(document.getElementById('select-75'), 'width') is '68px'
    9999PASS getComputedStyleForElement(document.getElementById('select-75'), 'height') is '18px'
  • trunk/LayoutTests/fast/replaced/table-percent-height.html

    r29039 r41876  
    100100
    101101    shouldBe("getComputedStyleForElement(document.getElementById('isindex-75'), 'width')", "'142px'");
    102     shouldBe("getComputedStyleForElement(document.getElementById('isindex-75'), 'height')", "'13px'");
     102    shouldBe("getComputedStyleForElement(document.getElementById('isindex-75'), 'height')", "'35px'");
    103103    shouldBe("getComputedStyleForElement(document.getElementById('isindex-100'), 'width')", "'142px'");
    104     shouldBe("getComputedStyleForElement(document.getElementById('isindex-100'), 'height')", "'13px'");
     104    shouldBe("getComputedStyleForElement(document.getElementById('isindex-100'), 'height')", "'49px'");
    105105
    106106    shouldBe("getComputedStyleForElement(document.getElementById('select-75'), 'width')", "'68px'");
  • trunk/WebCore/ChangeLog

    r41871 r41876  
     12009-03-20  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        - fix https://bugs.webkit.org/show_bug.cgi?id=23739
     6          <rdar://problem/6556371> REGRESSION (r36513): iframe isn't sized properly upon load
     7
     8        * rendering/RenderBlock.cpp:
     9        (WebCore::RenderBlock::percentHeightDescendants): Added this accessor.
     10        * rendering/RenderBlock.h:
     11        * rendering/RenderTableSection.cpp:
     12        (WebCore::RenderTableSection::layoutRows): Extended the check for
     13        children that flex to include other descendants with percent height
     14        which is relative to the cell.
     15
    1162009-03-20  Dmitry Titov  <dimich@chromium.org>
    217
  • trunk/WebCore/rendering/RenderBlock.cpp

    r41769 r41876  
    25292529
    25302530    delete containerSet;
     2531}
     2532
     2533HashSet<RenderBox*>* RenderBlock::percentHeightDescendants() const
     2534{
     2535    return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) : 0;
    25312536}
    25322537
  • trunk/WebCore/rendering/RenderBlock.h

    r41422 r41876  
    132132    void addPercentHeightDescendant(RenderBox*);
    133133    static void removePercentHeightDescendant(RenderBox*);
     134    HashSet<RenderBox*>* percentHeightDescendants() const;
    134135
    135136    virtual void positionListMarker() { }
  • trunk/WebCore/rendering/RenderTableSection.cpp

    r41203 r41876  
    538538
    539539            for (RenderObject* o = cell->firstChild(); o; o = o->nextSibling()) {
    540                 if (!o->isText() && o->style()->height().isPercent() && (o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow()) || flexAllChildren)) {
     540                if (!o->isText() && o->style()->height().isPercent() && (flexAllChildren || o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow()))) {
    541541                    // Tables with no sections do not flex.
    542542                    if (!o->isTable() || static_cast<RenderTable*>(o)->hasSections()) {
    543543                        o->setNeedsLayout(true, false);
    544                         cell->setChildNeedsLayout(true, false);
    545544                        cellChildrenFlex = true;
    546545                    }
    547546                }
    548547            }
    549            
     548
     549            if (HashSet<RenderBox*>* percentHeightDescendants = cell->percentHeightDescendants()) {
     550                HashSet<RenderBox*>::iterator end = percentHeightDescendants->end();
     551                for (HashSet<RenderBox*>::iterator it = percentHeightDescendants->begin(); it != end; ++it) {
     552                    RenderBox* box = *it;
     553                    if (!box->isReplaced() && !box->scrollsOverflow() && !flexAllChildren)
     554                        continue;
     555
     556                    while (box != cell) {
     557                        if (box->normalChildNeedsLayout())
     558                            break;
     559                        box->setChildNeedsLayout(true, false);
     560                        box = box->containingBlock();
     561                        ASSERT(box);
     562                        if (!box)
     563                            break;
     564                    }
     565                    cellChildrenFlex = true;
     566                }
     567            }
     568
    550569            if (cellChildrenFlex) {
     570                cell->setChildNeedsLayout(true, false);
    551571                // Alignment within a cell is based off the calculated
    552572                // height, which becomes irrelevant once the cell has
Note: See TracChangeset for help on using the changeset viewer.