[webkit-changes] cvs commit: SVGSupport/ksvg2/svg SVGDocumentImpl.cpp SVGDocumentImpl.h SVGUseElementImpl.cpp

Eric eseidel at opensource.apple.com
Sat Oct 8 02:18:16 PDT 2005


eseidel     05/10/08 02:18:16

  Modified:    .        ChangeLog
               ksvg2/svg SVGDocumentImpl.cpp SVGDocumentImpl.h
                        SVGUseElementImpl.cpp
  Log:
  Bug #: 5240
  Submitted by: Rob Buis  <rwlbuis at xs4all.nl>
  Reviewed by: eseidel
          Fix to handle forward referencing <use> elements.
          http://bugzilla.opendarwin.org/show_bug.cgi?id=5240
  
          * ksvg2/svg/SVGDocumentImpl.cpp:
          (SVGDocumentImpl::executeScripts): delayed close.
          (SVGDocumentImpl::addForwardReference): new function.
          * ksvg2/svg/SVGDocumentImpl.h:
          * ksvg2/svg/SVGUseElementImpl.cpp:
          (SVGUseElementImpl::close): delay close, if missing reference.
  
  Revision  Changes    Path
  1.219     +14 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.218
  retrieving revision 1.219
  diff -u -r1.218 -r1.219
  --- ChangeLog	8 Oct 2005 00:50:26 -0000	1.218
  +++ ChangeLog	8 Oct 2005 09:18:12 -0000	1.219
  @@ -1,3 +1,17 @@
  +2005-10-08  Rob Buis  <rwlbuis at xs4all.nl>
  +
  +        Reviewed by eseidel.
  +
  +        Fix to handle forward referencing <use> elements.
  +        http://bugzilla.opendarwin.org/show_bug.cgi?id=5240
  +
  +        * ksvg2/svg/SVGDocumentImpl.cpp:
  +        (SVGDocumentImpl::executeScripts): delayed close.
  +        (SVGDocumentImpl::addForwardReference): new function.
  +        * ksvg2/svg/SVGDocumentImpl.h:
  +        * ksvg2/svg/SVGUseElementImpl.cpp:
  +        (SVGUseElementImpl::close): delay close, if missing reference.
  +
   2005-10-07  David Harrison  <harrison at apple.com>
   
           Reviewed by Justin.
  
  
  
  1.11      +14 -0     SVGSupport/ksvg2/svg/SVGDocumentImpl.cpp
  
  Index: SVGDocumentImpl.cpp
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/svg/SVGDocumentImpl.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SVGDocumentImpl.cpp	5 Oct 2005 05:35:19 -0000	1.10
  +++ SVGDocumentImpl.cpp	8 Oct 2005 09:18:15 -0000	1.11
  @@ -818,6 +818,15 @@
       if(canvas() && needsStyleSelectorUpdate)
           updateStyleSelector();
   
  +    // close any unclosed nodes
  +    Q3PtrListIterator<SVGElementImpl> it(m_forwardReferences);
  +    for(;it.current(); ++it)
  +    {
  +        if(!it.current()->closed())
  +            it.current()->close();
  +    }
  +    m_forwardReferences.clear();
  +
       // Start animations, as "load" scripts are executed.
       m_timeScheduler->startAnimations();
   }
  @@ -1025,4 +1034,9 @@
       eventType->deref();
   }
   
  +void SVGDocumentImpl::addForwardReference(const SVGElementImpl *element)
  +{
  +    m_forwardReferences.append(element);
  +}
  +
   // vim:ts=4:noet
  
  
  
  1.8       +3 -0      SVGSupport/ksvg2/svg/SVGDocumentImpl.h
  
  Index: SVGDocumentImpl.h
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/svg/SVGDocumentImpl.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SVGDocumentImpl.h	8 Sep 2005 08:03:35 -0000	1.7
  +++ SVGDocumentImpl.h	8 Oct 2005 09:18:15 -0000	1.8
  @@ -97,6 +97,8 @@
           virtual void recalcStyleSelector();
           virtual void recalcStyle(StyleChange = NoChange);
   
  +        void addForwardReference(const SVGElementImpl *element);
  +
       protected:
           virtual KDOM::CSSStyleSelector *createStyleSelector(const QString &);
   
  @@ -118,6 +120,7 @@
           KDOM::CachedScript *m_cachedScript;
           Q3PtrList<SVGScriptElementImpl> m_scripts;
           Q3PtrListIterator<SVGScriptElementImpl> *m_scriptsIt;
  +        Q3PtrList<SVGElementImpl> m_forwardReferences;
       };
   };
   
  
  
  
  1.8       +5 -0      SVGSupport/ksvg2/svg/SVGUseElementImpl.cpp
  
  Index: SVGUseElementImpl.cpp
  ===================================================================
  RCS file: /cvs/root/SVGSupport/ksvg2/svg/SVGUseElementImpl.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SVGUseElementImpl.cpp	5 Oct 2005 05:35:30 -0000	1.7
  +++ SVGUseElementImpl.cpp	8 Oct 2005 09:18:15 -0000	1.8
  @@ -129,7 +129,10 @@
       KDOM::ElementImpl *targetElement = ownerDocument()->getElementById(targetId.handle());
       SVGElementImpl *target = svg_dynamic_cast(targetElement);
       if (!target)
  +    {
  +        getDocument()->addForwardReference(this);
           return;
  +    }
   
       float _x = x()->baseVal()->value(), _y = y()->baseVal()->value();
       float _w = width()->baseVal()->value(), _h = height()->baseVal()->value();
  @@ -179,6 +182,8 @@
           appendChild(dummy);
           dummy->appendChild(root);
       }
  +
  +    SVGElementImpl::close();
   }
   
   bool SVGUseElementImpl::hasChildNodes() const
  
  
  



More information about the webkit-changes mailing list