Changeset 88102 in webkit
- Timestamp:
- Jun 4, 2011 2:53:36 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88100 r88102 1 2011-06-04 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Convert RenderBox::overflowClipRect to IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=62032 7 8 Covered by existing tests. 9 10 * editing/Editor.cpp: 11 (WebCore::Editor::insideVisibleArea): 12 * platform/graphics/IntRect.h: 13 (WebCore::IntRect::contract): 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::nodeAtPoint): 16 * rendering/RenderBox.cpp: 17 (WebCore::RenderBox::pushContentsClip): 18 (WebCore::RenderBox::overflowClipRect): 19 * rendering/RenderBox.h: 20 * rendering/RenderBoxModelObject.cpp: 21 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 22 * rendering/RenderLayer.cpp: 23 (WebCore::RenderLayer::calculateClipRects): 24 (WebCore::RenderLayer::calculateRects): 25 (WebCore::RenderLayer::repaintBlockSelectionGaps): 26 * rendering/RenderLayerBacking.cpp: 27 (WebCore::clipBox): 28 * rendering/RenderTable.cpp: 29 (WebCore::RenderTable::overflowClipRect): 30 (WebCore::RenderTable::nodeAtPoint): 31 * rendering/RenderTable.h: 32 * rendering/RenderTableSection.cpp: 33 (WebCore::RenderTableSection::nodeAtPoint): 34 * rendering/svg/RenderSVGRoot.cpp: 35 (WebCore::RenderSVGRoot::paint): 36 1 37 2011-06-04 Adam Barth <abarth@webkit.org> 2 38 -
trunk/Source/WebCore/editing/Editor.cpp
r87770 r88102 2569 2569 return true; 2570 2570 2571 IntRect rectInPageCoords = container->overflowClipRect( 0, 0);2571 IntRect rectInPageCoords = container->overflowClipRect(IntPoint()); 2572 2572 IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1, 2573 2573 rectInPageCoords.width(), rectInPageCoords.height()); … … 2598 2598 return true; 2599 2599 2600 IntRect rectInPageCoords = container->overflowClipRect( 0, 0);2600 IntRect rectInPageCoords = container->overflowClipRect(IntPoint()); 2601 2601 IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1, 2602 2602 rectInPageCoords.width(), rectInPageCoords.height()); -
trunk/Source/WebCore/platform/graphics/IntRect.h
r88096 r88102 114 114 void expand(const IntSize& size) { m_size += size; } 115 115 void expand(int dw, int dh) { m_size.expand(dw, dh); } 116 void contract(const IntSize& size) { m_size -= size; } 117 void contract(int dw, int dh) { m_size.expand(-dw, -dh); } 116 118 117 119 void shiftXEdgeTo(int edge) -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r88087 r88102 3924 3924 bool useClip = (hasControlClip() || useOverflowClip); 3925 3925 IntRect hitTestArea(result.rectForPoint(pointInContainer)); 3926 bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(toPoint(localOffset)).intersects(hitTestArea) : overflowClipRect( localOffset.width(), localOffset.height(), IncludeOverlayScrollbarSize).intersects(hitTestArea));3926 bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(toPoint(localOffset)).intersects(hitTestArea) : overflowClipRect(toPoint(localOffset), IncludeOverlayScrollbarSize).intersects(hitTestArea)); 3927 3927 if (checkChildren) { 3928 3928 // Hit test descendants first. -
trunk/Source/WebCore/rendering/RenderBox.cpp
r88087 r88102 1115 1115 paintInfo.phase = PaintPhaseChildBlockBackgrounds; 1116 1116 } 1117 IntRect clipRect(isControlClip ? controlClipRect(IntPoint(tx, ty)) : overflowClipRect( tx, ty));1117 IntRect clipRect(isControlClip ? controlClipRect(IntPoint(tx, ty)) : overflowClipRect(IntPoint(tx, ty))); 1118 1118 paintInfo.context->save(); 1119 1119 if (style()->hasBorderRadius()) … … 1136 1136 } 1137 1137 1138 IntRect RenderBox::overflowClipRect( int tx, int ty, OverlayScrollbarSizeRelevancy relevancy)1138 IntRect RenderBox::overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy relevancy) 1139 1139 { 1140 1140 // FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the property 1141 1141 // here. 1142 1143 int bLeft = borderLeft(); 1144 int bTop = borderTop(); 1145 1146 int clipX = tx + bLeft; 1147 int clipY = ty + bTop; 1148 int clipWidth = width() - bLeft - borderRight(); 1149 int clipHeight = height() - bTop - borderBottom(); 1142 IntRect clipRect(location + IntSize(borderLeft(), borderTop()), 1143 size() - IntSize(borderLeft() + borderRight(), borderTop() + borderBottom())); 1150 1144 1151 1145 // Subtract out scrollbars if we have them. 1152 if (layer()) { 1153 clipWidth -= layer()->verticalScrollbarWidth(relevancy); 1154 clipHeight -= layer()->horizontalScrollbarHeight(relevancy); 1155 } 1156 1157 return IntRect(clipX, clipY, clipWidth, clipHeight); 1146 if (layer()) 1147 clipRect.contract(layer()->verticalScrollbarWidth(relevancy), layer()->horizontalScrollbarHeight(relevancy)); 1148 1149 return clipRect; 1158 1150 } 1159 1151 -
trunk/Source/WebCore/rendering/RenderBox.h
r88087 r88102 346 346 virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0); 347 347 348 virtual IntRect overflowClipRect( int tx, int ty, OverlayScrollbarSizeRelevancy relevancy = IgnoreOverlayScrollbarSize);348 virtual IntRect overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize); 349 349 IntRect clipRect(int tx, int ty); 350 350 virtual bool hasControlClip() const { return false; } -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r87753 r88102 656 656 if (clippedWithLocalScrolling) { 657 657 // Clip to the overflow area. 658 context->clip(toRenderBox(this)->overflowClipRect(rect. x(), rect.y()));658 context->clip(toRenderBox(this)->overflowClipRect(rect.location())); 659 659 660 660 // Adjust the paint rect to reflect a scrolled content box with borders at the ends. -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r87989 r88102 3375 3375 3376 3376 if (renderer()->hasOverflowClip()) { 3377 IntRect newOverflowClip = toRenderBox(renderer())->overflowClipRect(offset .x(), offset.y(), relevancy);3377 IntRect newOverflowClip = toRenderBox(renderer())->overflowClipRect(offset, relevancy); 3378 3378 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.overflowClipRect())); 3379 3379 if (renderer()->isPositioned() || renderer()->isRelPositioned()) … … 3439 3439 // This layer establishes a clip of some kind. 3440 3440 if (renderer()->hasOverflowClip()) 3441 foregroundRect.intersect(toRenderBox(renderer())->overflowClipRect(offset .x(), offset.y(), relevancy));3441 foregroundRect.intersect(toRenderBox(renderer())->overflowClipRect(offset, relevancy)); 3442 3442 if (renderer()->hasClip()) { 3443 3443 // Clip applies to *us* as well, so go ahead and update the damageRect. … … 3511 3511 rect.move(-scrolledContentOffset()); 3512 3512 if (renderer()->hasOverflowClip()) 3513 rect.intersect(toRenderBox(renderer())->overflowClipRect( 0, 0));3513 rect.intersect(toRenderBox(renderer())->overflowClipRect(IntPoint())); 3514 3514 if (renderer()->hasClip()) 3515 3515 rect.intersect(toRenderBox(renderer())->clipRect(0, 0)); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r87989 r88102 317 317 IntRect result = PaintInfo::infiniteRect(); 318 318 if (renderer->hasOverflowClip()) 319 result = renderer->overflowClipRect( 0, 0);319 result = renderer->overflowClipRect(IntPoint()); 320 320 321 321 if (renderer->hasClip()) -
trunk/Source/WebCore/rendering/RenderTable.cpp
r88087 r88102 1172 1172 } 1173 1173 1174 IntRect RenderTable::overflowClipRect( int tx, int ty, OverlayScrollbarSizeRelevancy relevancy)1175 { 1176 IntRect rect = RenderBlock::overflowClipRect( tx, ty, relevancy);1174 IntRect RenderTable::overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy relevancy) 1175 { 1176 IntRect rect = RenderBlock::overflowClipRect(location, relevancy); 1177 1177 1178 1178 // If we have a caption, expand the clip to include the caption. … … 1185 1185 if (style()->isHorizontalWritingMode()) { 1186 1186 rect.setHeight(height()); 1187 rect.setY( ty);1187 rect.setY(location.y()); 1188 1188 } else { 1189 1189 rect.setWidth(width()); 1190 rect.setX( tx);1190 rect.setX(location.x()); 1191 1191 } 1192 1192 } … … 1201 1201 1202 1202 // Check kids first. 1203 if (!hasOverflowClip() || overflowClipRect( tx, ty).intersects(result.rectForPoint(pointInContainer))) {1203 if (!hasOverflowClip() || overflowClipRect(IntPoint(tx, ty)).intersects(result.rectForPoint(pointInContainer))) { 1204 1204 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { 1205 1205 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) { -
trunk/Source/WebCore/rendering/RenderTable.h
r88087 r88102 232 232 virtual void computeLogicalWidth(); 233 233 234 virtual IntRect overflowClipRect( int tx, int ty, OverlayScrollbarSizeRelevancy relevancy = IgnoreOverlayScrollbarSize);234 virtual IntRect overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize); 235 235 236 236 virtual void addOverflowFromChildren(); -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r88087 r88102 1154 1154 ty += y(); 1155 1155 1156 if (hasOverflowClip() && !overflowClipRect( tx, ty).intersects(result.rectForPoint(pointInContainer)))1156 if (hasOverflowClip() && !overflowClipRect(IntPoint(tx, ty)).intersects(result.rectForPoint(pointInContainer))) 1157 1157 return false; 1158 1158 -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r88033 r88102 291 291 292 292 // Apply initial viewport clip - not affected by overflow handling 293 childPaintInfo.context->clip(overflowClipRect(borderBoxOriginInContainer .x(), borderBoxOriginInContainer.y()));293 childPaintInfo.context->clip(overflowClipRect(borderBoxOriginInContainer)); 294 294 295 295 // Convert from container offsets (html renderers) to a relative transform (svg renderers).
Note: See TracChangeset
for help on using the changeset viewer.