Changeset 151604 in webkit
- Timestamp:
- Jun 14, 2013 1:13:57 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r151600 r151604 1 2013-06-14 Arpita Bahuguna <a.bah@samsung.com> 2 3 Editing: wrong text position when you click enter on the text behind the image 4 https://bugs.webkit.org/show_bug.cgi?id=115023 5 6 Reviewed by Ryosuke Niwa. 7 8 * editing/inserting/insert-paragraph-after-non-editable-node-before-text-expected.txt: Added. 9 * editing/inserting/insert-paragraph-after-non-ediatble-node-before-text.html: Added. 10 Layout test added for verifying the insert paragraph behavior between an inline node 11 which is ignored for editing purposes and some text. 12 1 13 2013-06-14 Eric Carlson <eric.carlson@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r151603 r151604 1 2013-06-14 Arpita Bahuguna <a.bah@samsung.com> 2 3 Editing: wrong text position when you click enter on the text behind the image 4 https://bugs.webkit.org/show_bug.cgi?id=115023 5 6 Reviewed by Ryosuke Niwa. 7 8 When trying to break a line after an image followed by some text, contrary 9 to the expected behavior the text doesn't move to a new line, instead, the 10 caret position just shifts to the end of line. 11 12 As per the existing implementation for inserting a paragraph separator, 13 the insertion position obtained corresponds to the point after the image 14 element. 15 Since the insertion position doesn't resolve to being offset in the 16 following text node (0 offset), no splitting of text occurs and the block 17 to be inserted is placed after the containing (start) block (thereby 18 causing the caret position to shift). 19 20 If the computed insertionPosition points to an element that shall be 21 ignored for editing purposes (i.e. cannot have a VisiblePosition inside 22 it), and the position lies either at the start or at the end of such 23 an element, we should move our Position either upstream or 24 downstream (respectively) so as to obtain a valid position which can 25 be used further for splitting of the text. 26 27 Test: editing/inserting/insert-paragraph-after-non-editable-node-before-text.html 28 29 * editing/InsertParagraphSeparatorCommand.cpp: 30 (WebCore::InsertParagraphSeparatorCommand::doApply): 31 Moving the insertionPosition either upstream or downstream, if the point 32 lies either at the start or at the end of the anchor node. 33 The ensuing position, if a text node, can then be used for splitting of 34 the text correctly. 35 1 36 2013-06-14 Alberto Garcia <agarcia@igalia.com> 2 37 -
trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
r150481 r151604 318 318 insertionPosition = positionOutsideTabSpan(VisiblePosition(insertionPosition).deepEquivalent()); 319 319 320 // If the returned position lies either at the end or at the start of an element that is ignored by editing 321 // we should move to its upstream or downstream position. 322 if (editingIgnoresContent(insertionPosition.deprecatedNode())) { 323 if (insertionPosition.atLastEditingPositionForNode()) 324 insertionPosition = insertionPosition.downstream(); 325 else if (insertionPosition.atFirstEditingPositionForNode()) 326 insertionPosition = insertionPosition.upstream(); 327 } 328 320 329 // Make sure we do not cause a rendered space to become unrendered. 321 330 // FIXME: We need the affinity for pos, but pos.downstream() does not give it
Note: See TracChangeset
for help on using the changeset viewer.