[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/khtml-svg/svg
From:       Nikolas Zimmermann <wildfox () kde ! org>
Date:       2006-03-30 22:10:02
Message-ID: 1143756602.367601.7036.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 524678 by wildfox:

Actually implement SVGStyledElementImpl::rendererIsNeeded(), so that
we don't even build RenderObjects in the display="none" case...


 M  +4 -4      SVGGElementImpl.h  
 M  +1 -1      SVGLineElementImpl.h  
 M  +1 -1      SVGPathElementImpl.h  
 M  +1 -1      SVGPolyElementImpl.h  
 M  +1 -1      SVGRectElementImpl.h  
 M  +4 -4      SVGSVGElementImpl.h  
 M  +5 -0      SVGStyledElementImpl.cpp  
 M  +1 -1      SVGStyledElementImpl.h  
 M  +1 -1      SVGSwitchElementImpl.h  


--- branches/work/khtml-svg/svg/SVGGElementImpl.h #524677:524678
@@ -39,16 +39,16 @@
         SVGGElementImpl(DOM::DocumentPtr *doc);
         virtual ~SVGGElementImpl();
 
-		// khtml DOM Integration
-		virtual DOM::NodeImpl::Id id() const;
+        // khtml DOM Integration
+        virtual DOM::NodeImpl::Id id() const;
 
         virtual bool isValid() const { return SVGTestsImpl::isValid(); }
 
         // 'SVGGElement' functions
         virtual void parseAttribute(DOM::AttributeImpl *);
 
-		virtual bool rendererIsNeeded(khtml::RenderStyle *) { return true; }
-		virtual khtml::RenderObject *createRenderer(khtml::RenderArena *arena, \
khtml::RenderStyle *style); +        virtual bool rendererIsNeeded(khtml::RenderStyle \
*style) { return SVGStyledElementImpl::rendererIsNeeded(style); } +        virtual \
khtml::RenderObject *createRenderer(khtml::RenderArena *arena, khtml::RenderStyle \
*style);  };
 };
 
--- branches/work/khtml-svg/svg/SVGLineElementImpl.h #524677:524678
@@ -54,7 +54,7 @@
 
         virtual void parseAttribute(DOM::AttributeImpl *attr);
 
-        virtual bool rendererIsNeeded(khtml::RenderStyle *) { return true; }
+        virtual bool rendererIsNeeded(khtml::RenderStyle *style) { return \
SVGStyledElementImpl::rendererIsNeeded(style); }  virtual KCanvasPath *toPathData() \
const;  
         virtual const SVGStyledElementImpl *pushAttributeContext(const \
                SVGStyledElementImpl *context);
--- branches/work/khtml-svg/svg/SVGPathElementImpl.h #524677:524678
@@ -104,7 +104,7 @@
 
         virtual void parseAttribute(DOM::AttributeImpl *attr);
 
-        virtual bool rendererIsNeeded(khtml::RenderStyle *) { return true; }
+        virtual bool rendererIsNeeded(khtml::RenderStyle *style) { return \
SVGStyledElementImpl::rendererIsNeeded(style); }  virtual KCanvasPath *toPathData() \
const;  
     private:
--- branches/work/khtml-svg/svg/SVGPolyElementImpl.h #524677:524678
@@ -51,7 +51,7 @@
 
         virtual void parseAttribute(DOM::AttributeImpl *attr);
  
-		virtual bool rendererIsNeeded(khtml::RenderStyle *) { return true; }
+		virtual bool rendererIsNeeded(khtml::RenderStyle *style) { return \
SVGStyledElementImpl::rendererIsNeeded(style); }  
         virtual void notifyAttributeChange() const;
 
--- branches/work/khtml-svg/svg/SVGRectElementImpl.h #524677:524678
@@ -59,7 +59,7 @@
 
         virtual void parseAttribute(DOM::AttributeImpl *attr);
 
-        virtual bool rendererIsNeeded(khtml::RenderStyle *) { return true; }
+        virtual bool rendererIsNeeded(khtml::RenderStyle *style) { return \
SVGStyledElementImpl::rendererIsNeeded(style); }  virtual KCanvasPath *toPathData() \
const;  
         virtual const SVGStyledElementImpl *pushAttributeContext(const \
                SVGStyledElementImpl *context);
--- branches/work/khtml-svg/svg/SVGSVGElementImpl.h #524677:524678
@@ -54,8 +54,8 @@
         SVGSVGElementImpl(DOM::DocumentPtr *doc);
         virtual ~SVGSVGElementImpl();
 
-		// khtml DOM Integration
-		virtual DOM::NodeImpl::Id id() const;
+        // khtml DOM Integration
+        virtual DOM::NodeImpl::Id id() const;
 
         virtual bool isValid() const { return SVGTestsImpl::isValid(); }
 
@@ -127,8 +127,8 @@
         virtual SVGMatrixImpl *getScreenCTM() const;
         virtual SVGMatrixImpl *localMatrix() const;
 
-		virtual bool rendererIsNeeded(khtml::RenderStyle *) { return true; }
-		virtual khtml::RenderObject *createRenderer(khtml::RenderArena *arena, \
khtml::RenderStyle *style); +        virtual bool rendererIsNeeded(khtml::RenderStyle \
*style) { return SVGStyledElementImpl::rendererIsNeeded(style); } +        virtual \
khtml::RenderObject *createRenderer(khtml::RenderArena *arena, khtml::RenderStyle \
*style);  
         // 'virtual SVGZoomAndPan functions
         virtual void setZoomAndPan(unsigned short zoomAndPan, int &exceptioncode);
--- branches/work/khtml-svg/svg/SVGStyledElementImpl.cpp #524677:524678
@@ -66,6 +66,11 @@
     return pa()->getPropertyCSSValue(name);
 }
 
+bool SVGStyledElementImpl::rendererIsNeeded(khtml::RenderStyle *style)
+{
+    return (getDocument()->documentElement() == this) || (style->display() != \
khtml::NONE); +}
+
 khtml::RenderObject *SVGStyledElementImpl::createRenderer(khtml::RenderArena *arena, \
khtml::RenderStyle *style)  {
     RefPtr<KCanvasPath> pathData = toPathData();
--- branches/work/khtml-svg/svg/SVGStyledElementImpl.h #524677:524678
@@ -54,7 +54,7 @@
         virtual DOM::CSSValueImpl *getPresentationAttribute(const DOM::DOMString \
&name);  
         // This needs to be implemented.
-        virtual bool rendererIsNeeded(khtml::RenderStyle *) { return false; }
+        virtual bool rendererIsNeeded(khtml::RenderStyle *style);
         virtual KCanvasPath *toPathData() const { return 0; }
         virtual khtml::RenderObject *createRenderer(khtml::RenderArena *arena, \
khtml::RenderStyle *style);  virtual KCanvasResource *canvasResource() { return 0; }
--- branches/work/khtml-svg/svg/SVGSwitchElementImpl.h #524677:524678
@@ -45,7 +45,7 @@
         virtual bool isValid() const { return SVGTestsImpl::isValid(); }
 
         // Derived from: 'SVGStyledElementImpl'
-        virtual bool rendererIsNeeded(khtml::RenderStyle *) { return true; }
+        virtual bool rendererIsNeeded(khtml::RenderStyle *style) { return \
                SVGStyledElementImpl::rendererIsNeeded(style); }
         virtual bool childShouldCreateRenderer(DOM::NodeImpl *child) const;
 
         khtml::RenderObject *createRenderer(khtml::RenderArena *arena, \
khtml::RenderStyle *style);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic