[webkit-changes] cvs commit: WebCore/khtml/html html_tableimpl.cpp html_tableimpl.h

Adele adele at opensource.apple.com
Tue Aug 2 16:10:57 PDT 2005


adele       05/08/02 16:10:57

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               khtml/html Tag: Safari-2-0-branch html_tableimpl.cpp
                        html_tableimpl.h
  Log:
          Merged fix from TOT to Safari-2-0-branch
  
      2005-07-14  Justin Garcia  <justin.garcia at apple.com>
  
          Patch by Anders Carlsson and justin
  
          Reviewed by mjs
  
          Fixes the following related bugs:
          <http://bugzilla.opendarwin.org/show_bug.cgi?id=3298> insertRow generates DOM Exception if TABLE does not possess a TBODY
          <rdar://problem/4045213> insertRow fails on a <table> that has no <tbody> but does have other children in the DOM
          <rdar://problem/3609576> insertRow() on table object containing any characters but no TR & TD elements fails (3476)
  
          Does a better job of maintaining the firstBody variable so that it's not invalidated on .innerHTML = ""
          Better check for when to add an implicit tbody to hold the inserted row.
  
          Test cases added: (NONE)
          * layout-tests/fast/dom/HTMLTableElement/insert-row-expected.txt: Added.
          * layout-tests/fast/dom/HTMLTableElement/insert-row.html: Added.
  
          * khtml/html/html_tableimpl.cpp:
          (DOM::HTMLTableElementImpl::~HTMLTableElementImpl):
          (DOM::HTMLTableElementImpl::setTBody):
          (DOM::HTMLTableElementImpl::insertRow):
          (DOM::HTMLTableElementImpl::addChild):
          (DOM::HTMLTableElementImpl::childrenChanged):
          * khtml/html/html_tableimpl.h:
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4104.2.86 +30 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4104.2.85
  retrieving revision 1.4104.2.86
  diff -u -r1.4104.2.85 -r1.4104.2.86
  --- ChangeLog	2 Aug 2005 22:50:12 -0000	1.4104.2.85
  +++ ChangeLog	2 Aug 2005 23:10:49 -0000	1.4104.2.86
  @@ -1,3 +1,33 @@
  +2005-08-02  Adele Peterson  <adele at apple.com>
  +
  +        Merged fix from TOT to Safari-2-0-branch
  +
  +    2005-07-14  Justin Garcia  <justin.garcia at apple.com>
  +
  +        Patch by Anders Carlsson and justin
  +
  +        Reviewed by mjs
  +        
  +        Fixes the following related bugs: 
  +        <http://bugzilla.opendarwin.org/show_bug.cgi?id=3298> insertRow generates DOM Exception if TABLE does not possess a TBODY
  +        <rdar://problem/4045213> insertRow fails on a <table> that has no <tbody> but does have other children in the DOM
  +        <rdar://problem/3609576> insertRow() on table object containing any characters but no TR & TD elements fails (3476)
  +        
  +        Does a better job of maintaining the firstBody variable so that it's not invalidated on .innerHTML = ""
  +        Better check for when to add an implicit tbody to hold the inserted row.
  +
  +        Test cases added: (NONE)
  +        * layout-tests/fast/dom/HTMLTableElement/insert-row-expected.txt: Added.
  +        * layout-tests/fast/dom/HTMLTableElement/insert-row.html: Added.
  +
  +        * khtml/html/html_tableimpl.cpp:
  +        (DOM::HTMLTableElementImpl::~HTMLTableElementImpl):
  +        (DOM::HTMLTableElementImpl::setTBody):
  +        (DOM::HTMLTableElementImpl::insertRow):
  +        (DOM::HTMLTableElementImpl::addChild):
  +        (DOM::HTMLTableElementImpl::childrenChanged):
  +        * khtml/html/html_tableimpl.h:
  +
   2005-08-02  Geoffrey Garen  <ggaren at apple.com>
   
           Merged fix from TOT to Safari-2-0-branch
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.49.8.2  +18 -2     WebCore/khtml/html/html_tableimpl.cpp
  
  Index: html_tableimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_tableimpl.cpp,v
  retrieving revision 1.49.8.1
  retrieving revision 1.49.8.2
  diff -u -r1.49.8.1 -r1.49.8.2
  --- html_tableimpl.cpp	12 Jul 2005 20:50:35 -0000	1.49.8.1
  +++ html_tableimpl.cpp	2 Aug 2005 23:10:56 -0000	1.49.8.2
  @@ -70,6 +70,8 @@
   
   HTMLTableElementImpl::~HTMLTableElementImpl()
   {
  +    if (firstBody)
  +        firstBody->deref();
   }
   
   NodeImpl::Id HTMLTableElementImpl::id() const
  @@ -130,8 +132,10 @@
       int exceptioncode = 0;
       NodeImpl* r;
   
  +    s->ref();
       if(firstBody) {
           replaceChild ( s, firstBody, exceptioncode );
  +        firstBody->deref();
           r = s;
       } else
           r = appendChild( s, exceptioncode );
  @@ -214,7 +218,7 @@
       // (cf DOM2TS HTMLTableElement31 test)
       // (note: this is different from "if the table has no sections", since we can have
       // <TABLE><TR>)
  -    if(!firstBody && !head && !foot && !hasChildNodes())
  +    if(!firstBody && !head && !foot)
           setTBody( new HTMLTableSectionElementImpl(docPtr(), ID_TBODY, true /* implicit */) );
   
       //kdDebug(6030) << k_funcinfo << index << endl;
  @@ -354,14 +358,26 @@
   		foot = static_cast<HTMLTableSectionElementImpl *>(child);
   	    break;
   	case ID_TBODY:
  -	    if ( !firstBody )
  +	    if ( !firstBody ) {
   		firstBody = static_cast<HTMLTableSectionElementImpl *>(child);
  +                firstBody->ref();
  +            }
   	    break;
   	}
       }
       return retval;
   }
   
  +void HTMLTableElementImpl::childrenChanged()
  +{
  +     HTMLElementImpl::childrenChanged();
  +     
  +     if (firstBody && firstBody->parentNode() != this) {
  +         firstBody->deref();
  +         firstBody = 0;
  +     }
  +}
  +
   bool HTMLTableElementImpl::mapToEntry(NodeImpl::Id attr, MappedAttributeEntry& result) const
   {
       switch(attr) {
  
  
  
  1.18.10.1 +1 -0      WebCore/khtml/html/html_tableimpl.h
  
  Index: html_tableimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_tableimpl.h,v
  retrieving revision 1.18
  retrieving revision 1.18.10.1
  diff -u -r1.18 -r1.18.10.1
  --- html_tableimpl.h	19 Nov 2004 00:12:21 -0000	1.18
  +++ html_tableimpl.h	2 Aug 2005 23:10:57 -0000	1.18.10.1
  @@ -97,6 +97,7 @@
   
       // overrides
       virtual NodeImpl *addChild(NodeImpl *child);
  +    virtual void childrenChanged();
       
       virtual bool mapToEntry(NodeImpl::Id attr, MappedAttributeEntry& result) const;
       virtual void parseHTMLAttribute(HTMLAttributeImpl *attr);
  
  
  



More information about the webkit-changes mailing list