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

Beth bdakin at opensource.apple.com
Thu Oct 6 14:48:11 PDT 2005


bdakin      05/10/06 14:48:10

  Modified:    .        ChangeLog
               khtml/rendering render_container.cpp
               khtml/xml dom_nodeimpl.cpp
  Log:
  Bug #:
  Bug #:
  Bug #:
  Bug #:
  Bug #:
  
  Revision  Changes    Path
  1.211     +28 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.210
  retrieving revision 1.211
  diff -u -r1.210 -r1.211
  --- ChangeLog	6 Oct 2005 20:46:36 -0000	1.210
  +++ ChangeLog	6 Oct 2005 21:48:06 -0000	1.211
  @@ -1,3 +1,31 @@
  +EW2005-10-06  Beth Dakin  <bdakin at apple.com>
  +
  +        Reviewed by nobody.
  +
  +        Rolling out the assertions I put in place earlier today
  +	because they break the layout tests. 
  +
  +        * khtml/rendering/render_container.cpp:
  +        (RenderContainer::destroy):
  +        * khtml/xml/dom_nodeimpl.cpp:
  +        (DOM::NodeImpl::dispatchEvent):
  +        (DOM::NodeImpl::dispatchGenericEvent):
  +        (DOM::NodeImpl::dispatchHTMLEvent):
  +        (DOM::NodeImpl::dispatchWindowEvent):
  +        (DOM::NodeImpl::dispatchMouseEvent):
  +        (DOM::NodeImpl::dispatchSimulatedMouseEvent):
  +        (DOM::NodeImpl::dispatchUIEvent):
  +        (DOM::NodeImpl::dispatchKeyEvent):
  +        (DOM::NodeImpl::dispatchWheelEvent):
  +        (DOM::NodeImpl::detach):
  +        (DOM::ContainerNodeImpl::insertBefore):
  +        (DOM::ContainerNodeImpl::replaceChild):
  +        (DOM::ContainerNodeImpl::removeChild):
  +        (DOM::ContainerNodeImpl::removeChildren):
  +        (DOM::ContainerNodeImpl::appendChild):
  +        (DOM::ContainerNodeImpl::addChild):
  +        (DOM::ContainerNodeImpl::dispatchChildInsertedEvents):
  +
   2005-10-06  Beth Dakin  <bdakin at apple.com>
   
           Reviewed by Dave Harrison
  
  
  
  1.73      +0 -1      WebCore/khtml/rendering/render_container.cpp
  
  Index: render_container.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_container.cpp,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- render_container.cpp	6 Oct 2005 20:46:41 -0000	1.72
  +++ render_container.cpp	6 Oct 2005 21:48:09 -0000	1.73
  @@ -63,7 +63,6 @@
           continuation()->destroy();
       
       while (m_first) {
  -        assert(m_first->isAnonymous());
           if (m_first->isListMarker())
               m_first->remove();
           else
  
  
  
  1.199     +2 -60     WebCore/khtml/xml/dom_nodeimpl.cpp
  
  Index: dom_nodeimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
  retrieving revision 1.198
  retrieving revision 1.199
  diff -u -r1.198 -r1.199
  --- dom_nodeimpl.cpp	6 Oct 2005 20:46:41 -0000	1.198
  +++ dom_nodeimpl.cpp	6 Oct 2005 21:48:09 -0000	1.199
  @@ -95,25 +95,13 @@
   };
   
   #ifndef NDEBUG
  -
  -static int eventDispatchForbidden = 0;
  -
  -inline void forbidEventDispatch() { ++eventDispatchForbidden; }
  -inline void allowEventDispatch() { ASSERT(eventDispatchForbidden > 0); --eventDispatchForbidden; }
  -
   struct NodeImplCounter { 
       static int count; 
       ~NodeImplCounter() { /* if (count != 0) fprintf(stderr, "LEAK: %d NodeImpl\n", count); */ }
   };
   int NodeImplCounter::count = 0;
   static NodeImplCounter nodeImplCounter;
  -
  -#else
  -
  -inline void forbidEventDispatch() { }
  -inline void allowEventDispatch() { }
  -
  -#endif
  +#endif NDEBUG
   
   NodeImpl::NodeImpl(DocumentPtr *doc)
       : document(doc),
  @@ -519,8 +507,6 @@
   
   bool NodeImpl::dispatchEvent(EventImpl *evt, int &exceptioncode, bool tempEvent)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       if (!evt || evt->type().isEmpty()) { 
           exceptioncode = EventException::_EXCEPTION_OFFSET + EventException::UNSPECIFIED_EVENT_TYPE_ERR;
           return false;
  @@ -564,8 +550,6 @@
   
   bool NodeImpl::dispatchGenericEvent( EventImpl *evt, int &/*exceptioncode */)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -
       evt->ref();
   
       // ### check that type specified
  @@ -664,16 +648,12 @@
   
   bool NodeImpl::dispatchHTMLEvent(const AtomicString &eventType, bool canBubbleArg, bool cancelableArg)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       int exceptioncode = 0;
       return dispatchEvent(new EventImpl(eventType, canBubbleArg, cancelableArg), exceptioncode, true);
   }
   
   bool NodeImpl::dispatchWindowEvent(const AtomicString &eventType, bool canBubbleArg, bool cancelableArg)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       int exceptioncode = 0;
       EventImpl *evt = new EventImpl(eventType, canBubbleArg, cancelableArg);
       evt->ref();
  @@ -713,8 +693,6 @@
   
   bool NodeImpl::dispatchMouseEvent(QMouseEvent *_mouse, const AtomicString &overrideType, int overrideDetail)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       int detail = overrideDetail; // defaults to 0
       AtomicString eventType;
       if (!overrideType.isEmpty()) {
  @@ -773,8 +751,6 @@
   
   bool NodeImpl::dispatchSimulatedMouseEvent(const AtomicString &eventType)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       // Like Gecko, we just pass 0 for everything when we make a fake mouse event.
       // Internet Explorer instead gives the current mouse position and state.
       return dispatchMouseEvent(eventType, 0, 0, 0, 0, 0, 0, false, false, false, false);
  @@ -784,8 +760,6 @@
       int clientX, int clientY, int screenX, int screenY,
       bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -
       if (disabled()) // Don't even send DOM events for disabled controls..
           return true;
   
  @@ -841,8 +815,6 @@
   
   bool NodeImpl::dispatchUIEvent(const AtomicString &eventType, int detail)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -
       assert (!( (eventType != DOMFocusInEvent &&
                   eventType != DOMFocusOutEvent &&
                   eventType != DOMActivateEvent)));
  @@ -935,8 +907,6 @@
   
   bool NodeImpl::dispatchKeyEvent(QKeyEvent *key)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       int exceptioncode = 0;
       //kdDebug(6010) << "DOM::NodeImpl: dispatching keyboard event" << endl;
       KeyboardEventImpl *keyboardEventImpl = new KeyboardEventImpl(key, getDocument()->defaultView());
  @@ -961,8 +931,6 @@
   
   void NodeImpl::dispatchWheelEvent(QWheelEvent *e)
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       if (e->delta() == 0)
           return;
   
  @@ -1258,7 +1226,7 @@
   void NodeImpl::detach()
   {
   //    assert(m_attached);
  -    
  +
       if (m_render)
           m_render->destroy();
       m_render = 0;
  @@ -1855,8 +1823,6 @@
           if ( exceptioncode )
               return 0;
   
  -        forbidEventDispatch();
  -
           // Add child in the correct position
           if (prev)
               prev->setNextSibling(child);
  @@ -1872,8 +1838,6 @@
           if (attached() && !child->attached())
               child->attach();
   
  -        allowEventDispatch();
  -
           // Dispatch the mutation events
           dispatchChildInsertedEvents(child,exceptioncode);
   
  @@ -1920,8 +1884,6 @@
   
       // Add the new child(ren)
       while (child) {
  -        forbidEventDispatch();
  -                
           nextChild = isFragment ? child->nextSibling() : 0;
   
           // If child is already present in the tree, first remove it
  @@ -1945,8 +1907,6 @@
           if (attached() && !child->attached())
               child->attach();
   
  -        allowEventDispatch();
  -
           // Dispatch the mutation events
           dispatchChildInsertedEvents(child,exceptioncode);
   
  @@ -1989,8 +1949,6 @@
       if (exceptioncode)
           return 0;
   
  -    forbidEventDispatch();
  -
       // Remove from rendering tree
       if (oldChild->attached())
           oldChild->detach();
  @@ -2011,8 +1969,6 @@
   
       getDocument()->setDocumentChanged(true);
   
  -    allowEventDispatch();
  -
       // Dispatch post-removal mutation events
       dispatchSubtreeModifiedEvent();
   
  @@ -2038,8 +1994,6 @@
           // Fire removed from document mutation events.
           dispatchChildRemovalEvents(n, exceptionCode);
   
  -        forbidEventDispatch();
  -        
           if (n->attached())
   	    n->detach();
           n->setPreviousSibling(0);
  @@ -2052,8 +2006,6 @@
           n->deref();
   
           _first = next;
  -        
  -        allowEventDispatch();
       }
       _last = 0;
       
  @@ -2088,8 +2040,6 @@
       NodeImpl *child = isFragment ? newChild->firstChild() : newChild;
   
       while (child) {
  -        forbidEventDispatch();
  -        
           nextChild = isFragment ? child->nextSibling() : 0;
   
           // If child is already present in the tree, first remove it
  @@ -2118,8 +2068,6 @@
           // ### should we detach() it first if it's already attached?
           if (attached() && !child->attached())
               child->attach();
  -            
  -        allowEventDispatch();
             
           // Dispatch the mutation events
           dispatchChildInsertedEvents(child,exceptioncode);
  @@ -2184,8 +2132,6 @@
       if (getDocument()->isHTMLDocument() && !childAllowed(newChild))
           return 0;
   
  -    forbidEventDispatch();
  -    
       // just add it...
       newChild->setParent(this);
   
  @@ -2204,8 +2150,6 @@
           newChild->insertedIntoDocument();
       childrenChanged();
   
  -    allowEventDispatch();
  -
       if(newChild->nodeType() == Node::ELEMENT_NODE)
           return newChild;
       return this;
  @@ -2480,8 +2424,6 @@
   
   void ContainerNodeImpl::dispatchChildInsertedEvents( NodeImpl *child, int &exceptioncode )
   {
  -    ASSERT(eventDispatchForbidden == 0);
  -    
       if (inDocument())
           child->insertedIntoDocument();
       else
  
  
  



More information about the webkit-changes mailing list