Changeset 90590 in webkit
- Timestamp:
- Jul 7, 2011 2:16:15 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90589 r90590 1 2011-07-07 Emil A Eklund <eae@chromium.org> 2 3 Switch addFocusRingRects to to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=64114 5 6 Reviewed by Eric Seidel. 7 8 No new tests, no functionality changes. 9 10 * rendering/LayoutTypes.h: 11 (WebCore::flooredLayoutPoint): 12 * rendering/RenderBlock.cpp: 13 (WebCore::RenderBlock::addFocusRingRects): 14 * rendering/RenderBlock.h: 15 * rendering/RenderBox.cpp: 16 (WebCore::RenderBox::addFocusRingRects): 17 * rendering/RenderBox.h: 18 * rendering/RenderInline.cpp: 19 (WebCore::RenderInline::addFocusRingRects): 20 * rendering/RenderInline.h: 21 * rendering/RenderListBox.cpp: 22 (WebCore::RenderListBox::addFocusRingRects): 23 * rendering/RenderListBox.h: 24 * rendering/RenderObject.h: 25 (WebCore::RenderObject::addFocusRingRects): 26 * rendering/RenderTextControl.cpp: 27 (WebCore::RenderTextControl::addFocusRingRects): 28 * rendering/RenderTextControl.h: 29 * rendering/svg/RenderSVGContainer.cpp: 30 (WebCore::RenderSVGContainer::addFocusRingRects): 31 * rendering/svg/RenderSVGContainer.h: 32 * rendering/svg/RenderSVGImage.cpp: 33 (WebCore::RenderSVGImage::addFocusRingRects): 34 * rendering/svg/RenderSVGImage.h: 35 * rendering/svg/RenderSVGPath.cpp: 36 (WebCore::RenderSVGPath::addFocusRingRects): 37 * rendering/svg/RenderSVGPath.h: 38 1 39 2011-07-06 Adrienne Walker <enne@google.com> 2 40 -
trunk/Source/WebCore/rendering/LayoutTypes.h
r90530 r90590 63 63 } 64 64 65 inline LayoutPoint flooredLayoutPoint(const FloatSize& s) 66 { 67 return flooredIntPoint(s); 68 } 69 65 70 inline LayoutUnit roundedLayoutUnit(float value) 66 71 { -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r90573 r90590 5885 5885 } 5886 5886 5887 void RenderBlock::addFocusRingRects(Vector< IntRect>& rects, const IntPoint& additionalOffset)5887 void RenderBlock::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) 5888 5888 { 5889 5889 // For blocks inside inlines, we go ahead and include margins so that we run right up to the … … 5897 5897 // https://bugs.webkit.org/show_bug.cgi?id=46781 5898 5898 bool prevInlineHasLineBox = toRenderInline(inlineElementContinuation()->node()->renderer())->firstLineBox(); 5899 int topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : 0;5900 int bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : 0;5901 IntRect rect(additionalOffset.x(), additionalOffset.y() - topMargin, width(), height() + topMargin + bottomMargin);5899 float topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : static_cast<LayoutUnit>(0); 5900 float bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : static_cast<LayoutUnit>(0); 5901 LayoutRect rect(additionalOffset.x(), additionalOffset.y() - topMargin, width(), height() + topMargin + bottomMargin); 5902 5902 if (!rect.isEmpty()) 5903 5903 rects.append(rect); 5904 5904 } else if (width() && height()) 5905 rects.append( IntRect(additionalOffset, size()));5905 rects.append(LayoutRect(additionalOffset, size())); 5906 5906 5907 5907 if (!hasOverflowClip() && !hasControlClip()) { 5908 5908 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { 5909 int top = max(curr->lineTop(), curr->logicalTop());5910 int bottom = min(curr->lineBottom(), curr->logicalTop() + curr->logicalHeight());5911 IntRect rect(additionalOffset.x() + curr->x(), additionalOffset.y() + top, curr->logicalWidth(), bottom - top);5909 LayoutUnit top = max(curr->lineTop(), curr->logicalTop()); 5910 LayoutUnit bottom = min(curr->lineBottom(), curr->logicalTop() + curr->logicalHeight()); 5911 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y() + top, curr->logicalWidth(), bottom - top); 5912 5912 if (!rect.isEmpty()) 5913 5913 rects.append(rect); … … 5929 5929 5930 5930 if (inlineElementContinuation()) 5931 inlineElementContinuation()->addFocusRingRects(rects, floored IntPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()));5931 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location())); 5932 5932 } 5933 5933 -
trunk/Source/WebCore/rendering/RenderBlock.h
r90530 r90590 337 337 void addOverflowFromInlineChildren(); 338 338 339 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);339 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 340 340 341 341 #if ENABLE(SVG) -
trunk/Source/WebCore/rendering/RenderBox.cpp
r90530 r90590 511 511 } 512 512 513 void RenderBox::addFocusRingRects(Vector< IntRect>& rects, const IntPoint& additionalOffset)513 void RenderBox::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) 514 514 { 515 515 if (!size().isEmpty()) 516 rects.append( IntRect(additionalOffset, size()));516 rects.append(LayoutRect(additionalOffset, size())); 517 517 } 518 518 -
trunk/Source/WebCore/rendering/RenderBox.h
r90525 r90590 129 129 // Bounds of the outline box in absolute coords. Respects transforms 130 130 virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, IntPoint* cachedOffsetToRepaintContainer) const; 131 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);131 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 132 132 133 133 // Use this with caution! No type checking is done! -
trunk/Source/WebCore/rendering/RenderInline.cpp
r90530 r90590 1335 1335 } 1336 1336 1337 void RenderInline::addFocusRingRects(Vector< IntRect>& rects, const IntPoint& additionalOffset)1337 void RenderInline::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) 1338 1338 { 1339 1339 if (!alwaysCreateLineBoxes()) 1340 culledInlineAbsoluteRects(this, rects, to Size(additionalOffset));1340 culledInlineAbsoluteRects(this, rects, toLayoutSize(additionalOffset)); 1341 1341 else { 1342 1342 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) 1343 rects.append(enclosing IntRect(FloatRect(additionalOffset.x() + curr->x(), additionalOffset.y() + curr->y(), curr->width(), curr->height())));1343 rects.append(enclosingLayoutRect(FloatRect(additionalOffset.x() + curr->x(), additionalOffset.y() + curr->y(), curr->width(), curr->height()))); 1344 1344 } 1345 1345 … … 1358 1358 if (continuation()) { 1359 1359 if (continuation()->isInline()) 1360 continuation()->addFocusRingRects(rects, floored IntPoint(additionalOffset + continuation()->containingBlock()->location() - containingBlock()->location()));1360 continuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + continuation()->containingBlock()->location() - containingBlock()->location())); 1361 1361 else 1362 continuation()->addFocusRingRects(rects, floored IntPoint(additionalOffset + toRenderBox(continuation())->location() - containingBlock()->location()));1362 continuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + toRenderBox(continuation())->location() - containingBlock()->location())); 1363 1363 } 1364 1364 } -
trunk/Source/WebCore/rendering/RenderInline.h
r90530 r90590 76 76 LayoutSize relativePositionedInlineOffset(const RenderBox* child) const; 77 77 78 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);78 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 79 79 void paintOutline(GraphicsContext*, const IntPoint&); 80 80 -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r90515 r90590 305 305 } 306 306 307 void RenderListBox::addFocusRingRects(Vector< IntRect>& rects, const IntPoint& additionalOffset)307 void RenderListBox::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) 308 308 { 309 309 if (!isSpatialNavigationEnabled(frame())) -
trunk/Source/WebCore/rendering/RenderListBox.h
r90515 r90590 80 80 virtual void layout(); 81 81 82 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);82 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 83 83 84 84 virtual bool canBeProgramaticallyScrolled() const { return true; } -
trunk/Source/WebCore/rendering/RenderObject.h
r90530 r90590 778 778 void getTransformFromContainer(const RenderObject* container, const IntSize& offsetInContainer, TransformationMatrix&) const; 779 779 780 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&) { };780 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&) { }; 781 781 782 782 IntRect absoluteOutlineBounds() const -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r90069 r90590 584 584 } 585 585 586 void RenderTextControl::addFocusRingRects(Vector< IntRect>& rects, const IntPoint& additionalOffset)586 void RenderTextControl::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) 587 587 { 588 588 if (!size().isEmpty()) 589 rects.append( IntRect(additionalOffset, size()));589 rects.append(LayoutRect(additionalOffset, size())); 590 590 } 591 591 -
trunk/Source/WebCore/rendering/RenderTextControl.h
r89983 r90590 93 93 virtual void paintObject(PaintInfo&, const LayoutPoint&); 94 94 95 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);95 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 96 96 97 97 virtual bool canBeProgramaticallyScrolled() const { return true; } -
trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
r88250 r90590 140 140 141 141 // addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call 142 void RenderSVGContainer::addFocusRingRects(Vector< IntRect>& rects, const IntPoint&)142 void RenderSVGContainer::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&) 143 143 { 144 IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));144 LayoutRect paintRectInParent = enclosingLayoutRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates())); 145 145 if (!paintRectInParent.isEmpty()) 146 146 rects.append(paintRectInParent); -
trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h
r90048 r90590 52 52 virtual void layout(); 53 53 54 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);54 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 55 55 56 56 virtual FloatRect objectBoundingBox() const { return m_objectBoundingBox; } -
trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp
r88250 r90590 180 180 } 181 181 182 void RenderSVGImage::addFocusRingRects(Vector< IntRect>& rects, const IntPoint&)182 void RenderSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&) 183 183 { 184 184 // this is called from paint() after the localTransform has already been applied 185 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates());185 LayoutRect contentRect = enclosingLayoutRect(repaintRectInLocalCoordinates()); 186 186 if (!contentRect.isEmpty()) 187 187 rects.append(contentRect); -
trunk/Source/WebCore/rendering/svg/RenderSVGImage.h
r90048 r90590 58 58 virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; } 59 59 60 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);60 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 61 61 62 62 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); -
trunk/Source/WebCore/rendering/svg/RenderSVGPath.cpp
r88250 r90590 237 237 // This method is called from inside paintOutline() since we call paintOutline() 238 238 // while transformed to our coord system, return local coords 239 void RenderSVGPath::addFocusRingRects(Vector< IntRect>& rects, const IntPoint&)240 { 241 IntRect rect = enclosingIntRect(repaintRectInLocalCoordinates());239 void RenderSVGPath::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&) 240 { 241 LayoutRect rect = enclosingLayoutRect(repaintRectInLocalCoordinates()); 242 242 if (!rect.isEmpty()) 243 243 rects.append(rect); -
trunk/Source/WebCore/rendering/svg/RenderSVGPath.h
r90048 r90590 62 62 virtual void layout(); 63 63 virtual void paint(PaintInfo&, const LayoutPoint&); 64 virtual void addFocusRingRects(Vector< IntRect>&, const IntPoint&);64 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 65 65 66 66 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
Note: See TracChangeset
for help on using the changeset viewer.