Changeset 29483 in webkit
- Timestamp:
- Jan 14, 2008 5:31:19 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r29482 r29483 1 2008-01-14 Finnur Thorarinsson <finnur.webkit@gmail.com> 2 3 Reviewed by hyatt & eseidel. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=16844 6 RenderText::addLineBoxRects erroneously includes last char for boundingBox 7 8 This patch fixes an issue with addLineBoxRects not correctly calculating the 9 rects due to an off-by-one error in using box->end(). We were assuming that 10 end() gives the index past the last character, when in fact it gives the 11 index _of_ the last character. 12 13 Eric Seidel and I could not find a way to test this via DRT. This method is 14 only used by WebKit or Safari for displaying selection rects AFAICT. 15 16 * rendering/RenderText.cpp: 17 (WebCore::RenderText::addLineBoxRects): 18 1 19 2008-01-14 Darin Adler <darin@apple.com> 2 20 -
trunk/WebCore/rendering/RenderText.cpp
r29098 r29483 212 212 213 213 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 214 if (start <= box->start() && box->end() <= end) { 214 // Note: box->end() returns the index of the last character, not the index past it 215 if (start <= box->start() && box->end() < end) { 215 216 IntRect r = IntRect(x + box->xPos(), y + box->yPos(), box->width(), box->height()); 216 217 if (useSelectionHeight) { … … 221 222 rects.append(r); 222 223 } else { 223 unsigned realEnd = min(box->end() + 1, end); // box->end() points at the last char, not after it224 unsigned realEnd = min(box->end() + 1, end); 224 225 IntRect r = box->selectionRect(x, y, start, realEnd); 225 226 if (!r.isEmpty()) {
Note: See TracChangeset
for help on using the changeset viewer.