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

David harrison at opensource.apple.com
Thu Jun 23 12:47:51 PDT 2005


harrison    05/06/23 12:47:51

  Modified:    .        ChangeLog
               khtml/editing selection.cpp selection.h visible_position.cpp
                        visible_position.h
               khtml/rendering render_line.cpp render_line.h
                        render_object.cpp render_object.h
               khtml/xml dom_nodeimpl.cpp dom_nodeimpl.h
  Log:
          Test cases added: None needed for this debug-only utility code.
  
          - Make showTree() const.
          - Add showTree() for InlineBox.
          - Add showTree() for RenderObject.
  
          * khtml/editing/selection.cpp:
          (khtml::Selection::showTree):
          * khtml/editing/selection.h:
          * khtml/editing/visible_position.cpp:
          (khtml::VisiblePosition::showTree):
          * khtml/editing/visible_position.h:
          Make showTree() const.
  
          * khtml/rendering/render_line.cpp:
          (khtml::InlineBox::showTree):
          * khtml/rendering/render_line.h:
          Add showTree() for InlineBox.
  
          * khtml/rendering/render_object.cpp:
          (RenderObject::showTree):
          * khtml/rendering/render_object.h:
          Add showTree() for RenderObject.
  
          * khtml/xml/dom_nodeimpl.cpp:
          (appendAttributeDesc):
          (NodeImpl::showNode):
          (NodeImpl::showTree):
          (NodeImpl::showTreeAndMark):
          * khtml/xml/dom_nodeimpl.h:
          Make showTree() const.
  
  Revision  Changes    Path
  1.4307    +34 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4306
  retrieving revision 1.4307
  diff -u -r1.4306 -r1.4307
  --- ChangeLog	23 Jun 2005 19:13:53 -0000	1.4306
  +++ ChangeLog	23 Jun 2005 19:47:45 -0000	1.4307
  @@ -1,3 +1,37 @@
  +2005-06-23  David Harrison  <harrison at apple.com>
  +
  +        Test cases added: None needed for this debug-only utility code.
  +
  +        - Make showTree() const.
  +        - Add showTree() for InlineBox.
  +        - Add showTree() for RenderObject.
  +
  +        * khtml/editing/selection.cpp:
  +        (khtml::Selection::showTree):
  +        * khtml/editing/selection.h:
  +        * khtml/editing/visible_position.cpp:
  +        (khtml::VisiblePosition::showTree):
  +        * khtml/editing/visible_position.h:
  +        Make showTree() const.
  +        
  +        * khtml/rendering/render_line.cpp:
  +        (khtml::InlineBox::showTree):
  +        * khtml/rendering/render_line.h:
  +        Add showTree() for InlineBox.
  +        
  +        * khtml/rendering/render_object.cpp:
  +        (RenderObject::showTree):
  +        * khtml/rendering/render_object.h:
  +        Add showTree() for RenderObject.
  +        
  +        * khtml/xml/dom_nodeimpl.cpp:
  +        (appendAttributeDesc):
  +        (NodeImpl::showNode):
  +        (NodeImpl::showTree):
  +        (NodeImpl::showTreeAndMark):
  +        * khtml/xml/dom_nodeimpl.h:
  +        Make showTree() const.
  +
   2005-06-23  Vicki Murley  <vicki at apple.com>
   
   	- added template to be used when writing manual tests
  
  
  
  1.89      +1 -1      WebCore/khtml/editing/selection.cpp
  
  Index: selection.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/selection.cpp,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- selection.cpp	21 Jun 2005 18:11:10 -0000	1.88
  +++ selection.cpp	23 Jun 2005 19:47:48 -0000	1.89
  @@ -1094,7 +1094,7 @@
   }
   #undef FormatBufferSize
   
  -void Selection::showTree()
  +void Selection::showTree() const
   {
       if (m_start.node())
           m_start.node()->showTreeAndMark(m_start.node(), "S", m_end.node(), "E");
  
  
  
  1.39      +1 -1      WebCore/khtml/editing/selection.h
  
  Index: selection.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/selection.h,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- selection.h	17 Jun 2005 02:13:11 -0000	1.38
  +++ selection.h	23 Jun 2005 19:47:48 -0000	1.39
  @@ -119,7 +119,7 @@
   
   #ifndef NDEBUG
       void formatForDebugger(char *buffer, unsigned length) const;
  -    void showTree();
  +    void showTree() const;
   #endif
   
   private:
  
  
  
  1.51      +2 -2      WebCore/khtml/editing/visible_position.cpp
  
  Index: visible_position.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/visible_position.cpp,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- visible_position.cpp	21 Jun 2005 18:11:10 -0000	1.50
  +++ visible_position.cpp	23 Jun 2005 19:47:49 -0000	1.51
  @@ -409,10 +409,10 @@
       m_deepPosition.formatForDebugger(buffer, length);
   }
   
  -void VisiblePosition::showTree()
  +void VisiblePosition::showTree() const
   {
       if (m_deepPosition.node())
  -    m_deepPosition.node()->showTreeAndMark(m_deepPosition.node(), "*", NULL, NULL);
  +        m_deepPosition.node()->showTreeAndMark(m_deepPosition.node(), "*", NULL, NULL);
   }
   #endif
   
  
  
  
  1.29      +1 -1      WebCore/khtml/editing/visible_position.h
  
  Index: visible_position.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/visible_position.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- visible_position.h	17 Jun 2005 02:13:11 -0000	1.28
  +++ visible_position.h	23 Jun 2005 19:47:49 -0000	1.29
  @@ -82,7 +82,7 @@
   
   #ifndef NDEBUG
       void formatForDebugger(char *buffer, unsigned length) const;
  -    void showTree();
  +    void showTree() const;
   #endif
       
   private:
  
  
  
  1.40      +8 -0      WebCore/khtml/rendering/render_line.cpp
  
  Index: render_line.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_line.cpp,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- render_line.cpp	19 Mar 2005 22:36:50 -0000	1.39
  +++ render_line.cpp	23 Jun 2005 19:47:49 -0000	1.40
  @@ -105,6 +105,14 @@
       *(size_t *)ptr = sz;
   }
   
  +#ifndef NDEBUG
  +void InlineBox::showTree() const
  +{
  +    if (m_object)
  +        m_object->showTree();
  +}
  +#endif
  +
   long InlineBox::caretMinOffset() const 
   { 
       return 0; 
  
  
  
  1.26      +3 -0      WebCore/khtml/rendering/render_line.h
  
  Index: render_line.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_line.h,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- render_line.h	27 Jan 2005 16:02:21 -0000	1.25
  +++ render_line.h	23 Jun 2005 19:47:49 -0000	1.26
  @@ -74,6 +74,9 @@
       void* operator new(size_t sz) throw();
       
   public:
  +#ifndef NDEBUG
  +    void showTree() const;
  +#endif
       virtual bool isInlineBox() { return false; }
       virtual bool isInlineFlowBox() { return false; }
       virtual bool isContainer() { return false; }
  
  
  
  1.195     +6 -0      WebCore/khtml/rendering/render_object.cpp
  
  Index: render_object.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_object.cpp,v
  retrieving revision 1.194
  retrieving revision 1.195
  diff -u -r1.194 -r1.195
  --- render_object.cpp	11 May 2005 02:10:10 -0000	1.194
  +++ render_object.cpp	23 Jun 2005 19:47:49 -0000	1.195
  @@ -1378,6 +1378,12 @@
   	child = child->nextSibling();
       }
   }
  +
  +void RenderObject::showTree() const
  +{
  +    if (element())
  +        element()->showTree();
  +}
   #endif
   
   static NodeImpl *selectStartNode(const RenderObject *object)
  
  
  
  1.149     +1 -0      WebCore/khtml/rendering/render_object.h
  
  Index: render_object.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_object.h,v
  retrieving revision 1.148
  retrieving revision 1.149
  diff -u -r1.148 -r1.149
  --- render_object.h	3 May 2005 20:55:32 -0000	1.148
  +++ render_object.h	23 Jun 2005 19:47:49 -0000	1.149
  @@ -226,6 +226,7 @@
       QString information() const;
       virtual void printTree(int indent=0) const;
       virtual void dump(QTextStream *stream, QString ind = "") const;
  +    void showTree() const;
   #endif
   
       static RenderObject *createObject(DOM::NodeImpl* node, RenderStyle* style);
  
  
  
  1.156     +7 -7      WebCore/khtml/xml/dom_nodeimpl.cpp
  
  Index: dom_nodeimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
  retrieving revision 1.155
  retrieving revision 1.156
  diff -u -r1.155 -r1.156
  --- dom_nodeimpl.cpp	21 Jun 2005 18:11:10 -0000	1.155
  +++ dom_nodeimpl.cpp	23 Jun 2005 19:47:50 -0000	1.156
  @@ -1601,10 +1601,10 @@
   
   #ifndef NDEBUG
   
  -static void appendAttributeDesc(NodeImpl *node, QString &string, NodeImpl::Id attrID, QString attrDesc)
  +static void appendAttributeDesc(const NodeImpl *node, QString &string, NodeImpl::Id attrID, QString attrDesc)
   {
       if (node->isElementNode()) {
  -        DOMString attr = static_cast<ElementImpl *>(node)->getAttribute(attrID);
  +        DOMString attr = static_cast<const ElementImpl *>(node)->getAttribute(attrID);
           if (!attr.isEmpty()) {
               string += attrDesc;
               string += attr.string();
  @@ -1612,7 +1612,7 @@
       }
   }
   
  -void NodeImpl::showNode(const char *prefix)
  +void NodeImpl::showNode(const char *prefix) const
   {
       if (!prefix)
           prefix = "";
  @@ -1629,15 +1629,15 @@
       }
   }
   
  -void NodeImpl::showTree()
  +void NodeImpl::showTree() const
   {
  -    showTreeAndMark(this, "*", NULL, NULL);
  +    showTreeAndMark((NodeImpl *)this, "*", NULL, NULL);
   }
   
  -void NodeImpl::showTreeAndMark(NodeImpl * markedNode1, const char * markedLabel1, NodeImpl * markedNode2, const char * markedLabel2)
  +void NodeImpl::showTreeAndMark(NodeImpl * markedNode1, const char * markedLabel1, NodeImpl * markedNode2, const char * markedLabel2) const
   {
       NodeImpl *rootNode;
  -    NodeImpl *node = this;
  +    NodeImpl *node = (NodeImpl *)this;
       while(node->parentNode() != NULL && node->id() != ID_BODY)
           node = node->parentNode();
       rootNode = node;
  
  
  
  1.87      +3 -3      WebCore/khtml/xml/dom_nodeimpl.h
  
  Index: dom_nodeimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.h,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- dom_nodeimpl.h	17 Jun 2005 02:13:12 -0000	1.86
  +++ dom_nodeimpl.h	23 Jun 2005 19:47:50 -0000	1.87
  @@ -470,9 +470,9 @@
   #ifndef NDEBUG
       virtual void formatForDebugger(char *buffer, unsigned length) const;
   
  -    void showNode(const char *prefix="");
  -    void showTree();
  -    void showTreeAndMark(NodeImpl * markedNode1, const char * markedLabel1, NodeImpl * markedNode2, const char * markedLabel2);
  +    void showNode(const char *prefix="") const;
  +    void showTree() const;
  +    void showTreeAndMark(NodeImpl * markedNode1, const char * markedLabel1, NodeImpl * markedNode2, const char * markedLabel2) const;
   	
   #endif
   
  
  
  



More information about the webkit-changes mailing list