Changeset 429 for trunk/WebCore/rendering/RenderBlock.cpp
- Timestamp:
- 08/04/08 12:23:14 (5 months ago)
- Files:
-
- trunk/WebCore/rendering/RenderBlock.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/WebCore/rendering/RenderBlock.cpp
r424 r429 1824 1824 1825 1825 if (isBody() || isRoot() || hasOverflowClip() || isRelPositioned() || 1826 isFloatingOrPositioned() || isTableCell() || isInlineBlockOrInlineTable() || hasTransform()) 1826 isFloatingOrPositioned() || isTableCell() || isInlineBlockOrInlineTable() || hasTransform() || 1827 hasReflection() || hasMask()) 1827 1828 return true; 1828 1829 … … 1861 1862 int lastLeft = leftSelectionOffset(this, lastTop); 1862 1863 int lastRight = rightSelectionOffset(this, lastTop); 1864 paintInfo.context->save(); 1863 1865 fillSelectionGaps(this, tx, ty, tx, ty, lastTop, lastLeft, lastRight, &paintInfo); 1866 paintInfo.context->restore(); 1867 } 1868 } 1869 1870 static 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())); 1864 1879 } 1865 1880 } … … 1868 1883 int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* paintInfo) 1869 1884 { 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 1870 1903 // 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 1871 1904 // fixed). … … 2045 2078 int top = yPos + ty; 2046 2079 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; 2048 2082 if (width <= 0) 2049 2083 return IntRect(); … … 2058 2092 int blockX, int blockY, int tx, int ty, const PaintInfo* paintInfo) 2059 2093 { 2060 int left = xPos + tx;2094 int left = max(xPos + tx, blockX + max(leftSelectionOffset(rootBlock, yPos), leftSelectionOffset(rootBlock, yPos + height))); 2061 2095 int top = yPos + ty; 2062 2096 int right = blockX + min(rightSelectionOffset(rootBlock, yPos), rightSelectionOffset(rootBlock, yPos + height));
