Bug 3914 - Remove all dynamic_cast from KDOM
Summary: Remove all dynamic_cast from KDOM
Status: RESOLVED DUPLICATE of bug 3249
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-09 00:52 PDT by Eric Seidel (no email)
Modified: 2005-11-20 22:34 PST (History)
0 users

See Also:


Attachments
Removes many (but not all) dynamic_casts from kdom/ksvg2 (38.85 KB, patch)
2005-09-26 19:25 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Removes many (but not all) dynamic_casts from kdom/ksvg2 (33.66 KB, patch)
2005-09-27 01:03 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Various dynamic_cast fixes (79.18 KB, patch)
2005-10-09 13:44 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Further dynamic_cast fixes (2.42 KB, patch)
2005-10-20 13:53 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2005-07-09 00:52:53 PDT
RTTI support needs to go from WebCore+SVG.  In order to do that, we need to remove all dynamic_cast 
uses throughout kdom/ksvg2, etc.
Comment 1 Eric Seidel (no email) 2005-08-28 02:47:51 PDT
ben is working on this.
Comment 2 Eric Seidel (no email) 2005-09-26 19:25:48 PDT
Created attachment 4056 [details]
Removes many (but not all) dynamic_casts from kdom/ksvg2

There are 3 more types to remove:
SVGLocateable
SVGTests
DOMBridge
Comment 3 Eric Seidel (no email) 2005-09-26 19:26:36 PDT
Comment on attachment 4056 [details]
Removes many (but not all) dynamic_casts from kdom/ksvg2

Ignore the WebCore.xcodeproj changes, those will be removed before landing.
Comment 4 Eric Seidel (no email) 2005-09-27 01:03:06 PDT
Created attachment 4058 [details]
Removes many (but not all) dynamic_casts from kdom/ksvg2

A couple fixes (including a crasher).
Comment 5 Eric Seidel (no email) 2005-09-27 01:04:34 PDT
Comment on attachment 4058 [details]
Removes many (but not all) dynamic_casts from kdom/ksvg2

Removes 19 use of dynamic_cast from kdom/ksvg2
Comment 6 Maciej Stachowiak 2005-09-27 20:56:50 PDT
Comment on attachment 4058 [details]
Removes many (but not all) dynamic_casts from kdom/ksvg2

r=me
Comment 7 Rob Buis 2005-09-27 23:46:29 PDT
My first remarks:

          * Element element = document.getElementByID "foobar");
          * 
-         * DOMString href = element.getAttribute("href");
-         * DOMString documentBase = element.baseURI();
+         * DOMStringImpl href = element.getAttribute("href");
+         * DOMStringImpl documentBase = element.baseURI();
          *
-         * DOMString theCompleteURL(Helper::BuildURI(documentBase.handle(),
href.handle());
+         * DOMStringImpl theCompleteURL(Helper::BuildURI(documentBase.handle(),
href.handle());

Why is that needed?


RCS file: /cvs/root/SVGSupport/ksvg2/svg/SVGElementImpl.h,v
retrieving revision 1.6
diff -p -u -r1.6 ksvg2/svg/SVGElementImpl.h
--- ksvg2/svg/SVGElementImpl.h	8 Sep 2005 08:03:35 -0000	1.6
+++ ksvg2/svg/SVGElementImpl.h	27 Sep 2005 02:26:43 -0000
@@ -70,12 +70,16 @@ namespace KSVG
         virtual QString adjustViewportClipping() const { return QString::null; }
 
         SVGDocumentImpl *getDocument() const;
+        
+        virtual bool isStyled() const { return false; }
+        virtual bool isSVG() const { return false; }

I think we need better names.
Cheers,

Rob.
Comment 8 Eric Seidel (no email) 2005-10-02 14:57:41 PDT
Comment on attachment 4058 [details]
Removes many (but not all) dynamic_casts from kdom/ksvg2

Removing review+ flag to remove it from the "to commit" queue.
Comment 9 Rob Buis 2005-10-09 13:44:18 PDT
Created attachment 4269 [details]
Various dynamic_cast fixes

Most of the fixes are because adding two classes:

SVGStyledTransformableElementImpl and
SVGStyledLocatableElementImpl

This works fine for most of the classes, but SVGTextElementImpl inheritance
structure doesnt seem to fit in. In this patch it is not corrected, since it
would mean duplicating code and I'd like to see a better solution thant that.

Finally note that I did not really have the opportunity to do regression
testing on the patch.
Comment 10 Rob Buis 2005-10-20 13:53:53 PDT
Created attachment 4429 [details]
Further dynamic_cast fixes

Hi,

Here is a patch I needed to do after WildFox committed my previous
dynamic_cast fixing patch, since it was work in progress and I advanced some
more. This one and the previous one should give a clear picture of how the
situation now is in ksvg2 svn.
Cheers,

Rob.
Comment 11 Eric Seidel (no email) 2005-11-17 12:52:00 PST
There are only 4 left after my most recent work on the DOM merger
Comment 12 Eric Seidel (no email) 2005-11-20 22:34:55 PST
This was done as part of 3249

*** This bug has been marked as a duplicate of 3249 ***