[webkit-changes] cvs commit: WebCore/khtml/xml dom_nodeimpl.cpp

Darin darin at opensource.apple.com
Fri Dec 16 08:13:13 PST 2005


darin       05/12/16 08:13:13

  Modified:    .        ChangeLog
               .        ChangeLog
               khtml/xml dom_nodeimpl.cpp
  Added:       fast/js  replace-child-siblings-expected.txt
                        replace-child-siblings.html
  Log:
  LayoutTests:
  
          Reviewed and landed by Darin.
  
          Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=6069
          Assertion failure in RenderBlock::addChildToFlow during replaceChild
  
          * fast/js/replace-child-siblings-expected.txt: Added.
          * fast/js/replace-child-siblings.html: Added.
  
  WebCore:
  
          Reviewed and landed by Darin.
  
          Test: fast/js/replace-child-siblings.html
  
          Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=6069
          Assertion failure in RenderBlock::addChildToFlow during replaceChild
  
          * khtml/xml/dom_nodeimpl.cpp:
          (DOM::ContainerNodeImpl::replaceChild): If the new child was right
          before or right after the old child, then it just stays.
  
  Revision  Changes    Path
  1.157     +10 -0     LayoutTests/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/LayoutTests/ChangeLog,v
  retrieving revision 1.156
  retrieving revision 1.157
  diff -u -r1.156 -r1.157
  --- ChangeLog	15 Dec 2005 23:40:33 -0000	1.156
  +++ ChangeLog	16 Dec 2005 16:13:07 -0000	1.157
  @@ -1,3 +1,13 @@
  +2005-12-16  Mitz Pettel  <opendarwin.org at mitzpettel.com>
  +
  +        Reviewed and landed by Darin.
  +        
  +        Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=6069
  +        Assertion failure in RenderBlock::addChildToFlow during replaceChild
  +
  +        * fast/js/replace-child-siblings-expected.txt: Added.
  +        * fast/js/replace-child-siblings.html: Added.
  +
   2005-12-15  Adele Peterson  <adele at apple.com>
   
           Test for <rdar://problem/4258232> Crash in HTMLOptionElementImpl::index when option element has no corresponding select - http://www.mattkruse.com/javascript/datadumper/
  
  
  
  1.1                  LayoutTests/fast/js/replace-child-siblings-expected.txt
  
  Index: replace-child-siblings-expected.txt
  ===================================================================
  This is a test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6069 Assertion failure in RenderBlock::addChildToFlow during replaceChild. It tests whether replaceChild() works correctly when the new node and the old node are siblings.
  
  Test result: PASS
  
  
  
  
  
  1.1                  LayoutTests/fast/js/replace-child-siblings.html
  
  Index: replace-child-siblings.html
  ===================================================================
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <title>replaceChild siblings bug</title>
  <script>
  if (window.layoutTestController)
      layoutTestController.dumpAsText();
  
  function test() {
      var obj = document.getElementById('child1');
      var parent = document.getElementById('parent');
      var nextobj = document.getElementById('child2');
      var replaced = parent.replaceChild(obj, nextobj);
      document.getElementById('result').innerText = parent.children.length == 1 ? "PASS" : "FAIL";
  }
  </script>
  </head>
  <body onload="test()">
  <p>
  This is a test for <i>http://bugzilla.opendarwin.org/show_bug.cgi?id=6069 Assertion failure in RenderBlock::addChildToFlow during replaceChild</i>.
  It tests whether replaceChild() works correctly when the new node and the
  old node are siblings.
  </p>
  <hr>
  <p>Test result: <span id="result"></span></p>
  <div id="parent">
  <div id="child1"></div><div id="child2"></div>
  </div>
  </body>
  </html>
  
  
  
  1.546     +13 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.545
  retrieving revision 1.546
  diff -u -r1.545 -r1.546
  --- ChangeLog	16 Dec 2005 08:08:06 -0000	1.545
  +++ ChangeLog	16 Dec 2005 16:13:08 -0000	1.546
  @@ -1,3 +1,16 @@
  +2005-12-16  Mitz Pettel  <opendarwin.org at mitzpettel.com>
  +
  +        Reviewed and landed by Darin.
  +        
  +        Test: fast/js/replace-child-siblings.html
  +
  +        Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=6069
  +        Assertion failure in RenderBlock::addChildToFlow during replaceChild
  +        
  +        * khtml/xml/dom_nodeimpl.cpp:
  +        (DOM::ContainerNodeImpl::replaceChild): If the new child was right
  +        before or right after the old child, then it just stays.
  +        
   2005-12-15  Darin Adler  <darin at apple.com>
   
           Reviewed by Maciej.
  
  
  
  1.224     +3 -0      WebCore/khtml/xml/dom_nodeimpl.cpp
  
  Index: dom_nodeimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
  retrieving revision 1.223
  retrieving revision 1.224
  diff -u -r1.223 -r1.224
  --- dom_nodeimpl.cpp	14 Dec 2005 23:31:58 -0000	1.223
  +++ dom_nodeimpl.cpp	16 Dec 2005 16:13:12 -0000	1.224
  @@ -2214,6 +2214,9 @@
       if (exceptioncode)
           return 0;
   
  +    // If the new child was right before or right after the old child, nothing else needs to change
  +    if (prev == child || next == child)
  +        child = 0;
       // Add the new child(ren)
       while (child) {
           nextChild = isFragment ? child->nextSibling() : 0;
  
  
  



More information about the webkit-changes mailing list