Changeset 13372 in webkit


Ignore:
Timestamp:
Mar 18, 2006 1:39:14 AM (18 years ago)
Author:
hyatt
Message:

Fix for bug 7841, tables, table rows, and table row groups should
all support overflow:hidden.

Reviewed by eric

  • css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::adjustRenderStyle):
  • rendering/RenderTable.cpp: (WebCore::RenderTable::layout): (WebCore::RenderTable::paint): (WebCore::RenderTable::getOverflowClipRect):
  • rendering/RenderTable.h:
  • rendering/RenderTableCol.h: (WebCore::RenderTableCol::requiresLayer):
  • rendering/RenderTableRow.h: (WebCore::RenderTableRow::requiresLayer):
  • rendering/render_box.cpp: (WebCore::RenderBox::setStyle):
  • rendering/render_layer.cpp: (WebCore::RenderLayer::paintLayer):
Location:
trunk/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r13371 r13372  
     12006-03-18  David Hyatt  <hyatt@apple.com>
     2
     3        Fix for bug 7841, tables, table rows, and table row groups should
     4        all support overflow:hidden.
     5
     6        Reviewed by eric
     7
     8        * css/cssstyleselector.cpp:
     9        (WebCore::CSSStyleSelector::adjustRenderStyle):
     10        * rendering/RenderTable.cpp:
     11        (WebCore::RenderTable::layout):
     12        (WebCore::RenderTable::paint):
     13        (WebCore::RenderTable::getOverflowClipRect):
     14        * rendering/RenderTable.h:
     15        * rendering/RenderTableCol.h:
     16        (WebCore::RenderTableCol::requiresLayer):
     17        * rendering/RenderTableRow.h:
     18        (WebCore::RenderTableRow::requiresLayer):
     19        * rendering/render_box.cpp:
     20        (WebCore::RenderBox::setStyle):
     21        * rendering/render_layer.cpp:
     22        (WebCore::RenderLayer::paintLayer):
     23
    1242006-03-17  Alice Liu  <alice.liu@apple.com>
    225
  • trunk/WebCore/css/cssstyleselector.cpp

    r13369 r13372  
    10021002        style->addToTextDecorationsInEffect(style->textDecoration());
    10031003   
     1004    // Table rows, sections and the table itself will support overflow:hidden and will ignore scroll/auto.
     1005    // FIXME: Eventually table sections will support auto and scroll.
     1006    if (style->overflow() != OVISIBLE && style->overflow() != OHIDDEN &&
     1007        (style->display() == TABLE || style->display() == INLINE_TABLE ||
     1008         style->display() == TABLE_ROW_GROUP || style->display() == TABLE_ROW))
     1009        style->setOverflow(OVISIBLE);
     1010
    10041011    // Cull out any useless layers and also repeat patterns into additional layers.
    10051012    style->adjustBackgroundLayers();
  • trunk/WebCore/rendering/RenderTable.cpp

    r13358 r13372  
    265265
    266266    RenderObject *child = firstChild();
    267     while(child) {
     267    while (child) {
    268268        // FIXME: What about a form that has a display value that makes it a table section?
    269269        if (child->needsLayout() && !(child->element() && child->element()->hasTagName(formTag)))
     
    387387    if (paintAction == PaintActionBlockBackground)
    388388        return;
     389
    389390    // We don't paint our own background, but we do let the kids paint their backgrounds.
    390391    if (paintAction == PaintActionChildBlockBackgrounds)
     
    771772}
    772773
     774IntRect RenderTable::getOverflowClipRect(int tx, int ty)
     775{
     776    IntRect rect = RenderBlock::getOverflowClipRect(tx, ty);
     777   
     778    // If we have a caption, expand the clip to include the caption.
     779    // FIXME: Technically this is wrong, but it's virtually impossible to fix this
     780    // for real until captions have been re-written.
     781    // FIXME: This code assumes (like all our other caption code) that only top/bottom are
     782    // supported.  When we actually support left/right and stop mapping them to top/bottom,
     783    // we might have to hack this code first (depending on what order we do these bug fixes in).
     784    if (tCaption) {
     785        rect.setHeight(height());
     786        rect.setY(ty);
     787    }
     788
     789    return rect;
     790}
     791
    773792#ifndef NDEBUG
    774793void RenderTable::dump(QTextStream *stream, QString ind) const
  • trunk/WebCore/rendering/RenderTable.h

    r13149 r13372  
    159159    bool hasSections() const { return head || foot || firstBody; }
    160160
     161    virtual IntRect getOverflowClipRect(int tx, int ty);
     162
    161163private:
    162164    void recalcSections();
  • trunk/WebCore/rendering/RenderTableCol.h

    r12298 r13372  
    4242    virtual void updateFromElement();
    4343    virtual bool canHaveChildren() const;
     44    virtual bool requiresLayer() { return false; }
    4445
    4546#ifndef NDEBUG
  • trunk/WebCore/rendering/RenderTableRow.h

    r13366 r13372  
    4949
    5050    // The only time rows get a layer is when they have transparency.
    51     virtual bool requiresLayer() { return isTransparent(); }
     51    virtual bool requiresLayer() { return isTransparent() || hasOverflowClip(); }
    5252
    5353    virtual void paint(PaintInfo& i, int tx, int ty);
  • trunk/WebCore/rendering/render_box.cpp

    r13346 r13372  
    9494    }
    9595
    96     // FIXME: Note that we restrict overflow to blocks for now.  One day table bodies
    97     // will need to support overflow.
    9896    // We also handle <body> and <html>, whose overflow applies to the viewport.
    99     if (_style->overflow() != OVISIBLE && isBlockFlow() && !isRoot() && (!isBody() || !document()->isHTMLDocument()))
     97    if (_style->overflow() != OVISIBLE && !isRoot() && (!isBody() || !document()->isHTMLDocument()) &&
     98        (isRenderBlock() || isTableRow() || isTableSection()))
    10099        setHasOverflowClip();
    101100
  • trunk/WebCore/rendering/render_layer.cpp

    r13369 r13372  
    11051105        // Paint the background.
    11061106        RenderObject::PaintInfo info(p, damageRect, PaintActionBlockBackground, paintingRootForRenderer);
    1107         renderer()->paint(info, x - renderer()->xPos(), y - renderer()->yPos() + renderer()->borderTopExtra());       
     1107        renderer()->paint(info, x - renderer()->xPos(), y - renderer()->yPos() + renderer()->borderTopExtra());
     1108
    11081109        // Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
    11091110        // z-index.  We paint after we painted the background/border, so that the scrollbars will
Note: See TracChangeset for help on using the changeset viewer.