Changeset 85677 in webkit
- Timestamp:
- May 3, 2011 3:33:25 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85673 r85677 1 2011-05-03 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/8891395> -[DOMRange textRects] returns incorrect results for vertical or flipped text 6 https://bugs.webkit.org/show_bug.cgi?id=60067 7 8 No test because this code path is only used by the Objective-C API, which is not testable from DumpRenderTree. 9 10 * rendering/RenderText.cpp: 11 (WebCore::RenderText::absoluteRectsForRange): Use width/height instead of logicalWidth/logicalHeight here, 12 and perform the local-to-absolute mapping on the rects rather than their origin, in order to get the right 13 results for flipped writing modes. 14 1 15 2011-05-03 Anton Muhin <antonm@chromium.org> 2 16 -
trunk/Source/WebCore/rendering/RenderText.cpp
r85377 r85677 292 292 // Note: box->end() returns the index of the last character, not the index past it 293 293 if (start <= box->start() && box->end() < end) { 294 IntRect r = IntRect(box->x(), box->y(), box->logicalWidth(), box->logicalHeight());294 IntRect r = box->calculateBoundaries(); 295 295 if (useSelectionHeight) { 296 296 IntRect selectionRect = box->selectionRect(0, 0, start, end); 297 r.setHeight(selectionRect.height()); 298 r.setY(selectionRect.y()); 297 if (box->isHorizontal()) { 298 r.setHeight(selectionRect.height()); 299 r.setY(selectionRect.y()); 300 } else { 301 r.setWidth(selectionRect.width()); 302 r.setX(selectionRect.x()); 303 } 299 304 } 300 FloatPoint origin = localToAbsolute(r.location()); 301 r.setX(origin.x()); 302 r.setY(origin.y()); 303 rects.append(r); 305 rects.append(localToAbsoluteQuad(FloatQuad(r)).enclosingBoundingBox()); 304 306 } else { 305 307 unsigned realEnd = min(box->end() + 1, end); … … 308 310 if (!useSelectionHeight) { 309 311 // change the height and y position because selectionRect uses selection-specific values 310 r.setHeight(box->logicalHeight()); 311 r.setY(box->y()); 312 if (box->isHorizontal()) { 313 r.setHeight(box->logicalHeight()); 314 r.setY(box->y()); 315 } else { 316 r.setWidth(box->logicalWidth()); 317 r.setX(box->x()); 318 } 312 319 } 313 FloatPoint origin = localToAbsolute(r.location()); 314 localToAbsolute(origin); 315 r.setX(origin.x()); 316 r.setY(origin.y()); 317 rects.append(r); 320 rects.append(localToAbsoluteQuad(FloatQuad(r)).enclosingBoundingBox()); 318 321 } 319 322 }
Note: See TracChangeset
for help on using the changeset viewer.