Changeset 53200 in webkit


Ignore:
Timestamp:
Jan 13, 2010 1:23:38 PM (14 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=32495

Reviewed by Dan Bernstein.

font-size:small with background-color causes text to get clipped. Make sure to only paint within the lineTop/lineBottom of
a line for quirky inline flow boxes that didn't contribute to the overall height of the line.

Added fast/backgrounds/quirks-mode-line-boxes-backgrounds.html

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::computeVerticalOverflow):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):

Location:
trunk
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53198 r53200  
     12010-01-13  Dave Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32495
     6
     7        font-size:small with background-color causes text to get clipped.  Make sure to only paint within the lineTop/lineBottom of
     8        a line for quirky inline flow boxes that didn't contribute to the overall height of the line.
     9       
     10        Added fast/backgrounds/quirks-mode-line-boxes-backgrounds.html
     11
     12        * rendering/InlineFlowBox.cpp:
     13        (WebCore::InlineFlowBox::computeVerticalOverflow):
     14        (WebCore::InlineFlowBox::paintBoxDecorations):
     15        (WebCore::InlineFlowBox::paintMask):
     16
    1172010-01-13  Dumitru Daniliuc  <dumi@chromium.org>
    218
  • trunk/WebCore/rendering/InlineFlowBox.cpp

    r50852 r53200  
    533533    // Any spillage outside of the line top and bottom is not considered overflow.  We just ignore this, since it only happens
    534534    // from the "your ascent/descent don't affect the line" quirk.
    535     // FIXME: Technically this means there can be repaint errors in the case where a line box has a shadow or background that spills
    536     // outside of the block. We should consider making any line box that has anything to render just stop respecting the quirk or making
    537     // boxes that render something set visual overflow.
    538535    int topOverflow = max(y(), lineTop);
    539536    int bottomOverflow = min(y() + boxHeight, lineBottom);
     
    736733        return;
    737734
    738     // Move x/y to our coordinates.
    739     tx += m_x;
    740     ty += m_y;
    741    
     735    int x = m_x;
     736    int y = m_y;
    742737    int w = width();
    743738    int h = height();
    744739
     740    // Constrain our background/border painting to the line top and bottom if necessary.
     741    bool strictMode = renderer()->document()->inStrictMode();
     742    if (!hasTextChildren() && !strictMode) {
     743        RootInlineBox* rootBox = root();
     744        int bottom = min(rootBox->lineBottom(), y + h);
     745        y = max(rootBox->lineTop(), y);
     746        h = bottom - y;
     747    }
     748   
     749    // Move x/y to our coordinates.
     750    tx += x;
     751    ty += y;
     752   
    745753    GraphicsContext* context = paintInfo.context;
    746754   
     
    801809        return;
    802810
    803     // Move x/y to our coordinates.
    804     tx += m_x;
    805     ty += m_y;
    806    
     811    int x = m_x;
     812    int y = m_y;
    807813    int w = width();
    808814    int h = height();
     815
     816    // Constrain our background/border painting to the line top and bottom if necessary.
     817    bool strictMode = renderer()->document()->inStrictMode();
     818    if (!hasTextChildren() && !strictMode) {
     819        RootInlineBox* rootBox = root();
     820        int bottom = min(rootBox->lineBottom(), y + h);
     821        y = max(rootBox->lineTop(), y);
     822        h = bottom - y;
     823    }
     824   
     825    // Move x/y to our coordinates.
     826    tx += x;
     827    ty += y;
    809828
    810829    const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
Note: See TracChangeset for help on using the changeset viewer.