Changeset 7531

Show
Ignore:
Timestamp:
09/13/04 13:17:29 (4 years ago)
Author:
kocienda
Message:

Reviewed by John

Fix for this bug:

<rdar://problem/3784840> REGRESSION (Mail): Text is inserted in the wrong place after changing typing style

  • khtml/editing/htmlediting_impl.cpp: (khtml::InputTextCommandImpl::prepareForTextInsertion): Code to handle typing style did not check to see if the reference node used for the DOM node insertion operation was a block. If it is, then the new node containing the new editing style now is inserted at the start of the block, instead of after it.
Location:
trunk/WebCore
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog-2005-08-23

    r7529 r7531  
     12004-09-13  Ken Kocienda  <kocienda@apple.com> 
     2 
     3        Reviewed by John 
     4 
     5        Fix for this bug: 
     6         
     7        <rdar://problem/3784840> REGRESSION (Mail): Text is inserted in the wrong place after changing typing style 
     8 
     9        * khtml/editing/htmlediting_impl.cpp: 
     10        (khtml::InputTextCommandImpl::prepareForTextInsertion): Code to handle typing style did not 
     11        check to see if the reference node used for the DOM node insertion operation was a block. 
     12        If it is, then the new node containing the new editing style now is inserted at the start of the block, 
     13        instead of after it. 
     14 
    1152004-09-13  Ken Kocienda  <kocienda@apple.com> 
    216 
  • trunk/WebCore/khtml/editing/htmlediting_impl.cpp

    r7526 r7531  
    15451545            TextImpl *editingTextNode = document()->createEditingTextNode(""); 
    15461546            NodeImpl *node = endingSelection().start().upstream(StayInBlock).node(); 
    1547             insertNodeAfter(applyTypingStyle(editingTextNode), node); 
     1547            if (node->isBlockFlow()) 
     1548                insertNodeAt(applyTypingStyle(editingTextNode), node, 0); 
     1549            else 
     1550                insertNodeAfter(applyTypingStyle(editingTextNode), node); 
    15481551            pos = Position(editingTextNode, 0); 
    15491552        }