⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 106866 in webkit


Ignore:
Timestamp:
Feb 6, 2012, 4:00:37 PM (15 years ago)
Author:
leviw@chromium.org
Message:

Fix pixel snapping logic for FrameSets. This is for code correctness, but would never actually lead to incorrect renderings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp

    r104741 r106866  
    8383void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
    8484{
    85     if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
    86         return;
    87        
    88     // FIXME: We should do something clever when borders from distinct framesets meet at a join.
    89    
    90     // Fill first.
    91     GraphicsContext* context = paintInfo.context;
    92     ColorSpace colorSpace = style()->colorSpace();
    93     context->fillRect(borderRect, frameSet()->hasBorderColor() ? style()->visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
    94    
    95     // Now stroke the edges but only if we have enough room to paint both edges with a little
    96     // bit of the fill color showing through.
    97     if (borderRect.width() >= 3) {
    98         context->fillRect(IntRect(roundedIntPoint(borderRect.location()), IntSize(1, height())), borderStartEdgeColor(), colorSpace);
    99         context->fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y()), IntSize(1, height())), borderEndEdgeColor(), colorSpace);
    100     }
    101 }
    102 
    103 void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
    104 {
    10585    IntRect snappedBorderRect = pixelSnappedIntRect(borderRect);
    10686    if (!paintInfo.rect.intersects(snappedBorderRect))
    10787        return;
    108 
     88       
    10989    // FIXME: We should do something clever when borders from distinct framesets meet at a join.
    11090   
     
    11393    ColorSpace colorSpace = style()->colorSpace();
    11494    context->fillRect(snappedBorderRect, frameSet()->hasBorderColor() ? style()->visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
    115 
     95   
    11696    // Now stroke the edges but only if we have enough room to paint both edges with a little
    11797    // bit of the fill color showing through.
    118     if (borderRect.height() >= 3) {
    119         context->fillRect(IntRect(roundedIntPoint(borderRect.location()), IntSize(width(), 1)), borderStartEdgeColor(), colorSpace);
    120         context->fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1), IntSize(width(), 1)), borderEndEdgeColor(), colorSpace);
     98    if (snappedBorderRect.width() >= 3) {
     99        context->fillRect(IntRect(snappedBorderRect.location(), IntSize(1, snappedBorderRect.height())), borderStartEdgeColor(), colorSpace);
     100        context->fillRect(IntRect(IntPoint(snappedBorderRect.maxX() - 1, snappedBorderRect.y()), IntSize(1, snappedBorderRect.height())), borderEndEdgeColor(), colorSpace);
     101    }
     102}
     103
     104void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
     105{
     106    IntRect snappedBorderRect = pixelSnappedIntRect(borderRect);
     107    if (!paintInfo.rect.intersects(snappedBorderRect))
     108        return;
     109
     110    // FIXME: We should do something clever when borders from distinct framesets meet at a join.
     111   
     112    // Fill first.
     113    GraphicsContext* context = paintInfo.context;
     114    ColorSpace colorSpace = style()->colorSpace();
     115    context->fillRect(snappedBorderRect, frameSet()->hasBorderColor() ? style()->visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
     116
     117    // Now stroke the edges but only if we have enough room to paint both edges with a little
     118    // bit of the fill color showing through.
     119    if (snappedBorderRect.height() >= 3) {
     120        context->fillRect(IntRect(snappedBorderRect.location(), IntSize(width(), 1)), borderStartEdgeColor(), colorSpace);
     121        context->fillRect(IntRect(IntPoint(snappedBorderRect.x(), snappedBorderRect.maxY() - 1), IntSize(snappedBorderRect.width(), 1)), borderEndEdgeColor(), colorSpace);
    121122    }
    122123}
Note: See TracChangeset for help on using the changeset viewer.