Changeset 117392 in webkit
- Timestamp:
- May 16, 2012 9:09:47 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r117390 r117392 1 2012-05-16 Ryosuke Niwa <rniwa@webkit.org> 2 3 Moving caret up or down skips lines when there's a non-editable line 4 https://bugs.webkit.org/show_bug.cgi?id=81490 5 6 Reviewed by Eric Seidel. 7 8 Added a regression test. 9 10 * editing/selection/move-between-lines-of-different-editabilities.html: Added. 11 * editing/selection/move-by-word-visually-mac-expected.txt: Rebaselined a test case. It failed 12 before this change and still fails after this change. 13 1 14 2012-05-16 Luke Macpherson <macpherson@chromium.org> 2 15 -
trunk/LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt
r115788 r117392 88 88 Test 18, RTL: 89 89 Move left by one word 90 " abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 8, 12, 16, 20, 24, 28, 32, 36], <DIV>[0], "AAA kj AAA mn opq AAA AAA"[3, 6, 10, 13, 17, 21, 25] FAIL expected: [" abc def AAA AAA hij AAA AAA uvw xyz "[ 1, 5, 8, 12, 16, 20, 24, 28, 32, 36, ]"AAA kj AAA mn opq AAA AAA"[ 3, 6, 10, 13, 17, 21, 25]90 " abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 8, 12, 16, 20, 24, 28, 32, 36], <DIV>[0], <DIV>[0], "AAA kj AAA mn opq AAA AAA"[3, 6, 10, 13, 17, 21, 25] FAIL expected: [" abc def AAA AAA hij AAA AAA uvw xyz "[ 1, 5, 8, 12, 16, 20, 24, 28, 32, 36, ]"AAA kj AAA mn opq AAA AAA"[ 3, 6, 10, 13, 17, 21, 25] 91 91 " abc def AAA AAA hij AAA AAA uvw xyz "[36], <DIV>[0] FAIL expected "AAA kj AAA mn opq AAA AAA"[ 3] 92 <DIV>[0], <DIV>[0] FAIL expected "AAA kj AAA mn opq AAA AAA"[ 3] 92 93 Move right by one word 93 94 "AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 13, 9, 4, 1] -
trunk/Source/WebCore/ChangeLog
r117391 r117392 1 2012-05-16 Ryosuke Niwa <rniwa@webkit.org> 2 3 Moving caret up or down skips lines when there's a non-editable line 4 https://bugs.webkit.org/show_bug.cgi?id=81490 5 6 Reviewed by Eric Seidel. 7 8 The bug was caused by previousRootInlineBoxCandidatePosition and nextRootInlineBoxCandidatePosition 9 skipping leaf nodes that constitute a new line and belong to the same editable region because block elements 10 that separate lines are not editable so it looked as if all editable lines belong to a single line as far as 11 those two functions are concerned. 12 13 Fixed the bug by using the first leaf node that belongs to the same editable region but does not belong in 14 the same as the start node. 15 16 This patch is based on a patch authored by Yi Shen (Nokia). 17 18 Test: editing/selection/move-between-lines-of-different-editabilities.html 19 20 * editing/visible_units.cpp: 21 (WebCore::previousRootInlineBoxCandidatePosition): 22 (WebCore::nextRootInlineBoxCandidatePosition): 23 1 24 2012-05-16 MORITA Hajime <morrita@google.com> 2 25 -
trunk/Source/WebCore/editing/visible_units.cpp
r117359 r117392 61 61 } 62 62 63 static Node* enclosingNodeWithNonInlineRenderer(Node* node)64 {65 for (; node; node = node->parentNode()) {66 if (node->renderer() && !node->renderer()->isInline())67 return node;68 }69 return 0;70 }71 72 63 static Node* nextLeafWithSameEditability(Node* node, EditableType editableType = ContentIsEditable) 73 64 { … … 89 80 { 90 81 Node* highestRoot = highestEditableRoot(visiblePosition.deepEquivalent(), editableType); 91 Node* enclosingBlockNode = enclosingNodeWithNonInlineRenderer(node);92 82 Node* previousNode = previousLeafWithSameEditability(node, editableType); 93 83 94 while (previousNode && enclosingBlockNode == enclosingNodeWithNonInlineRenderer(previousNode))84 while (previousNode && inSameLine(firstPositionInOrBeforeNode(previousNode), visiblePosition)) 95 85 previousNode = previousLeafWithSameEditability(previousNode, editableType); 96 86 … … 113 103 { 114 104 Node* highestRoot = highestEditableRoot(visiblePosition.deepEquivalent(), editableType); 115 Node* enclosingBlockNode = enclosingNodeWithNonInlineRenderer(node);116 105 Node* nextNode = nextLeafWithSameEditability(node, editableType); 117 while (nextNode && enclosingBlockNode == enclosingNodeWithNonInlineRenderer(nextNode))106 while (nextNode && inSameLine(firstPositionInOrBeforeNode(nextNode), visiblePosition)) 118 107 nextNode = nextLeafWithSameEditability(nextNode, ContentIsEditable); 119 108
Note: See TracChangeset
for help on using the changeset viewer.