Show
Ignore:
Timestamp:
08/04/08 12:23:14 (5 months ago)
Author:
mbensi
Message:

merge with webkit revision 35534

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/WebCore/rendering/RenderBlock.cpp

    r424 r429  
    18241824         
    18251825    if (isBody() || isRoot() || hasOverflowClip() || isRelPositioned() || 
    1826         isFloatingOrPositioned() || isTableCell() || isInlineBlockOrInlineTable() || hasTransform()) 
     1826        isFloatingOrPositioned() || isTableCell() || isInlineBlockOrInlineTable() || hasTransform() || 
     1827        hasReflection() || hasMask()) 
    18271828        return true; 
    18281829     
     
    18611862        int lastLeft = leftSelectionOffset(this, lastTop); 
    18621863        int lastRight = rightSelectionOffset(this, lastTop); 
     1864        paintInfo.context->save(); 
    18631865        fillSelectionGaps(this, tx, ty, tx, ty, lastTop, lastLeft, lastRight, &paintInfo); 
     1866        paintInfo.context->restore(); 
     1867    } 
     1868} 
     1869 
     1870static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<RenderObject*>* positionedObjects) 
     1871{ 
     1872    if (!positionedObjects) 
     1873        return; 
     1874     
     1875    ListHashSet<RenderObject*>::const_iterator end = positionedObjects->end(); 
     1876    for (ListHashSet<RenderObject*>::const_iterator it = positionedObjects->begin(); it != end; ++it) { 
     1877        RenderObject* r = *it; 
     1878        paintInfo->context->clipOut(IntRect(tx + r->xPos(), ty + r->yPos(), r->width(), r->height())); 
    18641879    } 
    18651880} 
     
    18681883                                        int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* paintInfo) 
    18691884{ 
     1885    // IMPORTANT: Callers of this method that intend for painting to happen need to do a save/restore. 
     1886    // Clip out floating and positioned objects when painting selection gaps. 
     1887    if (paintInfo) { 
     1888        // Note that we don't clip out overflow for positioned objects.  We just stick to the border box. 
     1889        clipOutPositionedObjects(paintInfo, tx, ty, m_positionedObjects); 
     1890        if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects. 
     1891            for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock()) 
     1892                clipOutPositionedObjects(paintInfo, cb->xPos(), cb->yPos(), cb->m_positionedObjects); 
     1893        if (m_floatingObjects) { 
     1894            for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) { 
     1895                FloatingObject* r = it.current(); 
     1896                paintInfo->context->clipOut(IntRect(tx + r->m_left + r->m_renderer->marginLeft(),  
     1897                                                    ty + r->m_top + r->m_renderer->marginTop(), 
     1898                                                    r->m_renderer->width(), r->m_renderer->height())); 
     1899            } 
     1900        } 
     1901    } 
     1902 
    18701903    // FIXME: overflow: auto/scroll regions need more math here, since painting in the border box is different from painting in the padding box (one is scrolled, the other is 
    18711904    // fixed). 
     
    20452078    int top = yPos + ty; 
    20462079    int left = blockX + max(leftSelectionOffset(rootBlock, yPos), leftSelectionOffset(rootBlock, yPos + height)); 
    2047     int width = tx + xPos - left; 
     2080    int right = min(xPos + tx, blockX + min(rightSelectionOffset(rootBlock, yPos), rightSelectionOffset(rootBlock, yPos + height))); 
     2081    int width = right - left; 
    20482082    if (width <= 0) 
    20492083        return IntRect(); 
     
    20582092                                           int blockX, int blockY, int tx, int ty, const PaintInfo* paintInfo) 
    20592093{ 
    2060     int left = xPos + tx
     2094    int left = max(xPos + tx, blockX + max(leftSelectionOffset(rootBlock, yPos), leftSelectionOffset(rootBlock, yPos + height)))
    20612095    int top = yPos + ty; 
    20622096    int right = blockX + min(rightSelectionOffset(rootBlock, yPos), rightSelectionOffset(rootBlock, yPos + height));