Changeset 54117 in webkit
- Timestamp:
- Jan 31, 2010 4:54:49 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r54113 r54117 1 2010-01-28 Ojan Vafai <ojan@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Implement CSSOM Range.getClientRects for collapsed selections 6 https://bugs.webkit.org/show_bug.cgi?id=34239 7 8 Adds two cases to getClientRects test. 9 10 * fast/dom/Range/getClientRects-expected.txt: 11 * fast/dom/Range/getClientRects.html: 12 1 13 2010-01-31 Oliver Hunt <oliver@apple.com> 2 14 -
trunk/LayoutTests/fast/dom/Range/getClientRects-expected.txt
r48806 r54117 187 187 PASS rects[3].width is 212 188 188 PASS rects[3].height is 247 189 Test 9 190 FAIL rects.length should be 1. Was 0. 191 FAIL rects[0].left should be 8. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object. 192 FAIL rects[0].top should be 1903. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object. 193 FAIL rects[0].width should be 0. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object. 194 FAIL rects[0].height should be 18. Threw exception TypeError: Result of expression 'rects[0]' [undefined] is not an object. 195 Test 9b 196 PASS rects.length is 1 197 PASS rects[0].left is 8 198 PASS rects[0].top is 1903 199 PASS rects[0].width is 0 200 PASS rects[0].height is 18 189 201 PASS successfullyParsed is true 190 202 -
trunk/LayoutTests/fast/dom/Range/getClientRects.html
r48806 r54117 69 69 70 70 <div class="box" id="test8">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> 71 72 <br><br> 73 74 <div class="box" id="test9">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> 71 75 72 76 </div> … … 340 344 shouldBe("rects[3].height", "247"); 341 345 346 debug("Test 9"); 347 var range9 = document.createRange(); 348 // This case should match test 9b's results. Currently though getClientRects returns an empty list. 349 range9.setStart(document.getElementById('test9'), 0); 350 show(range9); 351 rects = range9.getClientRects(); 352 shouldBe("rects.length", "1"); 353 shouldBe("rects[0].left", "8"); 354 shouldBe("rects[0].top", "1903"); 355 shouldBe("rects[0].width", "0"); 356 shouldBe("rects[0].height", "18"); 357 358 debug("Test 9b"); 359 var range9 = document.createRange(); 360 range9.setStart(document.getElementById('test9').firstChild, 0); 361 show(range9); 362 rects = range9.getClientRects(); 363 shouldBe("rects.length", "1"); 364 shouldBe("rects[0].left", "8"); 365 shouldBe("rects[0].top", "1903"); 366 shouldBe("rects[0].width", "0"); 367 shouldBe("rects[0].height", "18"); 368 342 369 if (window.layoutTestController) { 343 370 var area = document.getElementById('testArea'); -
trunk/WebCore/ChangeLog
r54115 r54117 1 2010-01-28 Ojan Vafai <ojan@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Implement CSSOM Range.getClientRects for collapsed selections 6 https://bugs.webkit.org/show_bug.cgi?id=34239 7 8 When getting the quads for a range on a text node, allow returning 9 zero width quads. This leaves the case of collapsed selections inside 10 elements still not fixed, but no worse. 11 12 * rendering/InlineTextBox.cpp: 13 (WebCore::InlineTextBox::selectionRect): 14 * rendering/RenderText.cpp: 15 (WebCore::RenderText::absoluteQuadsForRange): 16 1 17 2010-01-31 Oliver Hunt <oliver@apple.com> 2 18 -
trunk/WebCore/rendering/InlineTextBox.cpp
r52548 r54117 109 109 int ePos = min(endPos - m_start, (int)m_len); 110 110 111 if (sPos > =ePos)111 if (sPos > ePos) 112 112 return IntRect(); 113 113 -
trunk/WebCore/rendering/RenderText.cpp
r52786 r54117 289 289 unsigned realEnd = min(box->end() + 1, end); 290 290 IntRect r = box->selectionRect(0, 0, start, realEnd); 291 if ( !r.isEmpty()) {291 if (r.height()) { 292 292 if (!useSelectionHeight) { 293 293 // change the height and y position because selectionRect uses selection-specific values
Note: See TracChangeset
for help on using the changeset viewer.