Changeset 112399 in webkit
- Timestamp:
- Mar 28, 2012 8:00:42 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112398 r112399 1 2012-03-28 Yi Shen <yi.4.shen@nokia.com> 2 3 An extra line break is inserted when pasting into a font element. 4 https://bugs.webkit.org/show_bug.cgi?id=71207 5 6 Reviewed by Ryosuke Niwa. 7 8 Fix an editing bug where inserting text into a font element would 9 create an extra div element in the dom tree. The 10 WebCore::positionAvoidingPrecedingNodes() tries to set the correct 11 destination position by checking the next visible position, however, 12 it causes the position moves into the child element in somecase. 13 Instead, we should only check the position in parent after node. 14 15 * editing/inserting/insert-text-into-font-expected.txt: Added. 16 * editing/inserting/insert-text-into-font.html: Added. 17 1 18 2012-03-28 Mihai Balan <mibalan@adobe.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r112396 r112399 1 2012-03-28 Yi Shen <yi.4.shen@nokia.com> 2 3 An extra line break is inserted when pasting into a font element. 4 https://bugs.webkit.org/show_bug.cgi?id=71207 5 6 Reviewed by Ryosuke Niwa. 7 8 Fix an editing bug where inserting text into a font element would 9 create an extra div element in the dom tree. The 10 WebCore::positionAvoidingPrecedingNodes() tries to set the correct 11 destination position by checking the next visible position, however, 12 it causes the position moves into the child element in somecase. 13 Instead, we should only check the position in parent after node. 14 15 Test: editing/inserting/insert-text-into-font.html 16 17 * editing/ReplaceSelectionCommand.cpp: 18 (WebCore::positionAvoidingPrecedingNodes): 19 1 20 2012-03-28 Sergio Villar Senin <svillar@igalia.com> 2 21 -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r111895 r112399 122 122 // <div>foo^</div>^ 123 123 // The two positions above are the same visual position, but we want to stay in the same block. 124 Node* stopNode = pos.deprecatedNode()->enclosingBlockFlowElement(); 125 while (stopNode != pos.deprecatedNode() && VisiblePosition(pos) == VisiblePosition(pos.next())) 126 pos = pos.next(); 124 Node* enclosingBlockNode = enclosingBlock(pos.containerNode()); 125 for (Position nextPosition = pos; nextPosition.containerNode() != enclosingBlockNode; pos = nextPosition) { 126 if (pos.containerNode()->nonShadowBoundaryParentNode()) 127 nextPosition = positionInParentAfterNode(pos.containerNode()); 128 129 if (nextPosition == pos 130 || enclosingBlock(nextPosition.containerNode()) != enclosingBlockNode 131 || VisiblePosition(pos) != VisiblePosition(nextPosition)) 132 break; 133 } 127 134 return pos; 128 135 }
Note: See TracChangeset
for help on using the changeset viewer.