Changeset 88264 in webkit
- Timestamp:
- Jun 7, 2011 2:06:26 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88263 r88264 1 2011-06-07 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch ContainerNode to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=61893 7 8 Covered by existing tests. 9 10 * dom/ContainerNode.cpp: 11 (WebCore::ContainerNode::getUpperLeftCorner): 12 (WebCore::ContainerNode::getLowerRightCorner): 13 (WebCore::ContainerNode::getRect): 14 Change to use maxX/maxY instead of x+width/y+height 15 16 * platform/graphics/FloatPoint.h: 17 (WebCore::FloatPoint::move): 18 (WebCore::FloatPoint::moveBy): 19 (WebCore::FloatPoint::expandedTo): 20 Add move, moveBy and expandedTo mirroring the IntPoint implementation of the same. 21 1 22 2011-06-07 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r87128 r88264 879 879 } else if (o->isBox()) { 880 880 RenderBox* box = toRenderBox(o); 881 point.move (box->x(), box->y());881 point.moveBy(box->location()); 882 882 } 883 883 point = o->container()->localToAbsolute(point, false, true); … … 905 905 RenderBox* box = toRenderBox(o); 906 906 point = o->localToAbsolute(FloatPoint(), false, true); 907 point.move(box-> width(), box->height());907 point.move(box->size()); 908 908 return true; 909 909 } … … 931 931 RenderText* text = toRenderText(o); 932 932 IntRect linesBox = text->linesBoundingBox(); 933 if (!linesBox. x() && !linesBox.width() && !linesBox.y() && !linesBox.height())933 if (!linesBox.maxX() && !linesBox.maxY()) 934 934 continue; 935 point.move (linesBox.x() + linesBox.width(), linesBox.y() + linesBox.height());935 point.moveBy(linesBox.maxXMaxYCorner()); 936 936 } else { 937 937 RenderBox* box = toRenderBox(o); 938 point.move (box->x() + box->width(), box->y() + box->height());938 point.moveBy(box->frameRect().maxXMaxYCorner()); 939 939 } 940 940 point = o->container()->localToAbsolute(point, false, true); … … 960 960 } 961 961 962 lowerRight.setX(max(upperLeft.x(), lowerRight.x())); 963 lowerRight.setY(max(upperLeft.y(), lowerRight.y())); 964 965 return enclosingIntRect(FloatRect(upperLeft, lowerRight - upperLeft)); 962 return enclosingIntRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft)); 966 963 } 967 964 -
trunk/Source/WebCore/platform/graphics/FloatPoint.h
r87880 r88264 92 92 m_y += dy; 93 93 } 94 void move(const IntSize& a) 95 { 96 m_x += a.width(); 97 m_y += a.height(); 98 } 99 void moveBy(const IntPoint& a) 100 { 101 m_x += a.x(); 102 m_y += a.y(); 103 } 94 104 void scale(float sx, float sy) 95 105 { … … 110 120 return m_x * m_x + m_y * m_y; 111 121 } 122 123 FloatPoint expandedTo(const FloatPoint& other) const 124 { 125 return FloatPoint(std::max(m_x, other.m_x), std::max(m_y, other.m_y)); 126 } 112 127 113 128 #if USE(CG) || USE(SKIA_ON_MAC_CHROME)
Note: See TracChangeset
for help on using the changeset viewer.