Changeset 38898 in webkit
- Timestamp:
- Dec 1, 2008 11:24:15 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r38892 r38898 1 2008-12-01 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Tests for https://bugs.webkit.org/show_bug.cgi?id=13736 REGRESSION 6 (r19811): Using the down arrow in a textarea gets "stuck" at the 7 end of a wrapped line 8 And corresponding: <rdar://problem/5347931> 9 10 * editing/selection/wrapped-line-caret-1.html: Added. 11 * editing/selection/wrapped-line-caret-2.html: Added. 12 * platform/mac/editing/selection/wrapped-line-caret-1- 13 expected.checksum: Added. 14 * platform/mac/editing/selection/wrapped-line-caret-1-expected.png: 15 Added. 16 * platform/mac/editing/selection/wrapped-line-caret-1-expected.txt: 17 Added. 18 * platform/mac/editing/selection/wrapped-line-caret-2- 19 expected.checksum: Added. 20 * platform/mac/editing/selection/wrapped-line-caret-2-expected.png: 21 Added. 22 * platform/mac/editing/selection/wrapped-line-caret-2-expected.txt: 23 Added. 24 1 25 2008-12-01 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 2 26 -
trunk/WebCore/ChangeLog
r38897 r38898 1 2008-12-01 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=13736 REGRESSION 6 (r19811): Using the down arrow in a textarea gets "stuck" at the 7 end of a wrapped line 8 And corresponding: <rdar://problem/5347931> 9 10 The basic problem here is that Position::getInlineBoxAndOffset() 11 failed to look beyond a single renderer. This patch looks for a 12 better match beyond the first renderer when the affinity is 13 downstream and we failed to find a "perfect" match. 14 * dom/Position.cpp: 15 (WebCore::isNonTextLeafChild): 16 (WebCore::searchAheadForBetterMatch): 17 (WebCore::Position::getInlineBoxAndOffset): 18 19 This is a fix I made based on code inspection. It looks like the 20 old code here and skipped over the parent as a possible match. 21 * rendering/RenderObject.cpp: 22 (WebCore::RenderObject::nextInPreOrderAfterChildren): 23 1 24 2008-12-01 Brent Fulgham <bfulgham@gmail.com> 2 25 -
trunk/WebCore/dom/Position.cpp
r36698 r38898 35 35 #include "Logging.h" 36 36 #include "PositionIterator.h" 37 #include "RenderBlock.h" 37 38 #include "Text.h" 38 39 #include "TextIterator.h" … … 772 773 } 773 774 775 static bool isNonTextLeafChild(RenderObject* object) 776 { 777 if (object->firstChild()) 778 return false; 779 if (object->isText()) 780 return false; 781 return true; 782 } 783 784 static InlineTextBox* searchAheadForBetterMatch(RenderObject* renderer) 785 { 786 InlineTextBox* match = 0; 787 int minOffset = INT_MAX; 788 RenderBlock* container = renderer->containingBlock(); 789 RenderObject* next = renderer; 790 while ((next = next->nextInPreOrder(container))) { 791 if (next->isRenderBlock()) 792 break; 793 if (next->isBR()) 794 break; 795 if (isNonTextLeafChild(next)) 796 break; 797 if (next->isText()) { 798 for (InlineTextBox* box = static_cast<RenderText*>(next)->firstTextBox(); box; box = box->nextTextBox()) { 799 int caretMinOffset = box->caretMinOffset(); 800 if (caretMinOffset < minOffset) { 801 match = box; 802 minOffset = caretMinOffset; 803 } 804 } 805 } 806 } 807 return match; 808 } 809 774 810 void Position::getInlineBoxAndOffset(EAffinity affinity, TextDirection primaryDirection, InlineBox*& inlineBox, int& caretOffset) const 775 811 { … … 802 838 803 839 candidate = box; 840 } 841 if (candidate && !box && affinity == DOWNSTREAM) { 842 box = searchAheadForBetterMatch(textRenderer); 843 if (box) 844 caretOffset = box->caretMinOffset(); 804 845 } 805 846 inlineBox = box ? box : candidate; -
trunk/WebCore/rendering/RenderObject.cpp
r38651 r38898 319 319 o = parent(); 320 320 while (o && !o->nextSibling()) { 321 o = o->parent();322 321 if (o == stayWithin) 323 322 return 0; 323 o = o->parent(); 324 324 } 325 325 if (o)
Note: See TracChangeset
for help on using the changeset viewer.