[webkit-changes] cvs commit: WebCore/khtml/editing replace_selection_command.cpp

Justin justing at opensource.apple.com
Tue Jun 21 18:15:44 PDT 2005


justing     05/06/21 18:15:44

  Modified:    .        ChangeLog
               khtml/editing replace_selection_command.cpp
  Log:
  	- Fixes <rdar://problem/4114192>.
  	- Fixes a crash in TOT Mail/Blot if you Edit -> Add Hyperlink on a Selection
  	   that ends at the end of the document
  	- Fixes a problem in TOT Mail/Blot where Edit -> Add Hyperlink creates
  	   a link one character beyond what is expected.
  
  	In replacement, during insertion, some special case code was being called inappropriately.
  
          Reviewed by Harrison
  
          Test cases added: None, requires manual interaction
  
          * khtml/editing/replace_selection_command.cpp:
          (khtml::ReplaceSelectionCommand::doApply): In "step 2" of a replacement, we should
          only next() the insertion point if the special pre-insertion-merge actually occured.
          mergeStart used to be the correct check for the occurence of a pre-insertion-merge, but
          a bug fix made this not the case.  A non-null m_lastNodeInserted correctly signals
          that some pre-insertion merging occured.
  
  Revision  Changes    Path
  1.4296    +18 -26    WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4295
  retrieving revision 1.4296
  diff -u -r1.4295 -r1.4296
  --- ChangeLog	22 Jun 2005 00:48:40 -0000	1.4295
  +++ ChangeLog	22 Jun 2005 01:15:40 -0000	1.4296
  @@ -1,31 +1,23 @@
  -2005-06-21  Adele Peterson  <adele at apple.com>
  +2005-06-21  Justin Garcia  <justin.garcia at apple.com>
   
  -        rolling out fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3293, since it caused layout test failures.
  -	fast/forms/element-by-name
  -        fast/loader/loadInProgress
  +	- Fixes <rdar://problem/4114192>.
  +	- Fixes a crash in TOT Mail/Blot if you Edit -> Add Hyperlink on a Selection 
  +	   that ends at the end of the document
  +	- Fixes a problem in TOT Mail/Blot where Edit -> Add Hyperlink creates 
  +	   a link one character beyond what is expected.
  +	
  +	In replacement, during insertion, some special case code was being called inappropriately.
  +	
  +        Reviewed by Harrison
   
  -        * ChangeLog:
  -        * khtml/ecma/kjs_binding.h:
  -        * khtml/ecma/kjs_css.cpp:
  -        (KJS::DOMCSSStyleDeclaration::hasProperty):
  -        * khtml/ecma/kjs_css.h:
  -        * khtml/ecma/kjs_dom.cpp:
  -        (KJS::DOMNodeList::hasProperty):
  -        (KJS::DOMNamedNodeMap::hasProperty):
  -        * khtml/ecma/kjs_dom.h:
  -        * khtml/ecma/kjs_html.cpp:
  -        (KJS::HTMLDocument::hasProperty):
  -        (KJS::KJS::HTMLElement::hasProperty):
  -        (KJS::KJS::HTMLCollection::hasProperty):
  -        * khtml/ecma/kjs_html.h:
  -        * khtml/ecma/kjs_window.cpp:
  -        (KJS::Window::hasProperty):
  -        (KJS::Konqueror::hasProperty):
  -        * khtml/ecma/kjs_window.h:
  -        * layout-tests/fast/js/eval-var-decl-expected.txt: Removed. This test used hasOwnProperty
  -        * layout-tests/fast/js/eval-var-decl.html: Removed. This test used hasOwnProperty
  -        * layout-tests/fast/js/hasOwnProperty-expected.txt: Removed.
  -        * layout-tests/fast/js/hasOwnProperty.html: Removed.
  +        Test cases added: None, requires manual interaction
  +
  +        * khtml/editing/replace_selection_command.cpp:
  +        (khtml::ReplaceSelectionCommand::doApply): In "step 2" of a replacement, we should 
  +        only next() the insertion point if the special pre-insertion-merge actually occured.
  +        mergeStart used to be the correct check for the occurence of a pre-insertion-merge, but
  +        a bug fix made this not the case.  A non-null m_lastNodeInserted correctly signals 
  +        that some pre-insertion merging occured.
   
   2005-06-21  Darin Adler  <darin at apple.com>
   
  
  
  
  1.2       +3 -2      WebCore/khtml/editing/replace_selection_command.cpp
  
  Index: replace_selection_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/replace_selection_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- replace_selection_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ replace_selection_command.cpp	22 Jun 2005 01:15:43 -0000	1.2
  @@ -785,7 +785,7 @@
       if (mergeStart && !isFirstVisiblePositionInSpecialElementInFragment(Position(m_fragment.mergeStartNode(), 0))) {
           NodeImpl *refNode = m_fragment.mergeStartNode();
           if (refNode) {
  -            NodeImpl *node = refNode ? refNode->nextSibling() : 0;
  +            NodeImpl *node = refNode->nextSibling();
               insertNodeAtAndUpdateNodesInserted(refNode, startPos.node(), startPos.offset());
               while (node && !isProbablyBlock(node)) {
                   NodeImpl *next = node->nextSibling();
  @@ -817,7 +817,8 @@
               insertNodeBeforeAndUpdateNodesInserted(refNode, insertionBlock);
           else if (!insertionBlockIsRoot && isProbablyBlock(refNode) && isEndOfBlock(visiblePos)) {
               insertNodeAfterAndUpdateNodesInserted(refNode, insertionBlock);
  -        } else if (mergeStart && !isProbablyBlock(refNode)) {
  +        // Insert the rest of the fragment at the NEXT visible position ONLY IF part of the fragment was already merged AND !isProbablyBlock
  +        } else if (m_lastNodeInserted && !isProbablyBlock(refNode)) {
               Position pos = visiblePos.next().deepEquivalent().downstream();
               insertNodeAtAndUpdateNodesInserted(refNode, pos.node(), pos.offset());
           } else {
  
  
  



More information about the webkit-changes mailing list