WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
94419
Clean up SVGLocatable inheritance
https://bugs.webkit.org/show_bug.cgi?id=94419
Summary
Clean up SVGLocatable inheritance
Philip Rogers
Reported
2012-08-18 16:11:41 PDT
SVGLocatable's inheritance chain is a little crufty. SVGTransformableElement inherits from SVGLocatableElement but unnecessarily re-defines the SVGLocatable functions. Furthermore, SVGPathElement defines getBBox() but the function is deadcode.
Attachments
Cleanup SVGLocatable inheritance
(5.27 KB, patch)
2012-08-18 16:20 PDT
,
Philip Rogers
no flags
Details
Formatted Diff
Diff
Remove incorrect getBBox() code
(2.20 KB, patch)
2012-08-19 22:29 PDT
,
Philip Rogers
krit
: review+
krit
: commit-queue-
Details
Formatted Diff
Diff
Update comment.
(2.22 KB, patch)
2012-08-20 09:27 PDT
,
Philip Rogers
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Philip Rogers
Comment 1
2012-08-18 16:20:18 PDT
Created
attachment 159276
[details]
Cleanup SVGLocatable inheritance
Philip Rogers
Comment 2
2012-08-18 16:28:38 PDT
Reviewers: for context, here's an incomplete but useful description of the inheritance tree:
https://docs.google.com/a/chromium.org/drawings/d/1h9TLoPbMI6h6q_RZK3BNgVc0nhxkBWStkpTYYozzeWU/edit
Build Bot
Comment 3
2012-08-18 16:48:44 PDT
Comment on
attachment 159276
[details]
Cleanup SVGLocatable inheritance
Attachment 159276
[details]
did not pass win-ews (win): Output:
http://queues.webkit.org/results/13529452
Philip Rogers
Comment 4
2012-08-18 17:03:03 PDT
The windows build has a warning that is causing the build to fail. This is real and might be why the code was architected this way to begin with.
http://msdn.microsoft.com/en-us/library/6b3sy7ae(v=vs.80).aspx
The issue is we have a diamond inheritance chain: SVGLocatable -> SVGTransformable -> SVGStyledTransformableElement SVGLocatable -> SVGStyledLocatable -> SVGStyledLocatableElement -> SVGStyledTransformableElement getBBox() is only defined on SVGStyledLocatableElement but the win build is complaining that SVGStyledTransformableElement.getBBox() doesn't know which of the two parents to use. Removing the review flag for now.
Dirk Schulze
Comment 5
2012-08-18 17:44:55 PDT
(In reply to
comment #4
)
> The windows build has a warning that is causing the build to fail. This is real and might be why the code was architected this way to begin with. >
http://msdn.microsoft.com/en-us/library/6b3sy7ae(v=vs.80).aspx
> > The issue is we have a diamond inheritance chain: > SVGLocatable -> SVGTransformable -> SVGStyledTransformableElement > SVGLocatable -> SVGStyledLocatable -> SVGStyledLocatableElement -> SVGStyledTransformableElement > getBBox() is only defined on SVGStyledLocatableElement but the win build is complaining that SVGStyledTransformableElement.getBBox() doesn't know which of the two parents to use. > > Removing the review flag for now.
Yes, we had this issue before that prevent us from cleaning up in the past. However, like said before, we will have a major refactoring later anyway. Since SVG 2 will switch to WebIDL, multiple inheritances are not allowed anymore. Don't spend to much time on it yet.
Philip Rogers
Comment 6
2012-08-18 17:48:57 PDT
(In reply to
comment #5
)
> (In reply to
comment #4
) > > The windows build has a warning that is causing the build to fail. This is real and might be why the code was architected this way to begin with. > >
http://msdn.microsoft.com/en-us/library/6b3sy7ae(v=vs.80).aspx
> > > > The issue is we have a diamond inheritance chain: > > SVGLocatable -> SVGTransformable -> SVGStyledTransformableElement > > SVGLocatable -> SVGStyledLocatable -> SVGStyledLocatableElement -> SVGStyledTransformableElement > > getBBox() is only defined on SVGStyledLocatableElement but the win build is complaining that SVGStyledTransformableElement.getBBox() doesn't know which of the two parents to use. > > > > Removing the review flag for now. > > Yes, we had this issue before that prevent us from cleaning up in the past. However, like said before, we will have a major refactoring later anyway. Since SVG 2 will switch to WebIDL, multiple inheritances are not allowed anymore. Don't spend to much time on it yet.
Sounds good to me; I'm not a fan of multiple inheritance. Want me to extract out the deadcode removal in SVGPathElement and land that? It's genuinely wrong and confusing for anyone looking at bounding box code.
Philip Rogers
Comment 7
2012-08-19 22:29:30 PDT
Created
attachment 159333
[details]
Remove incorrect getBBox() code Extracting out the useful piece from the previous patch.
Dirk Schulze
Comment 8
2012-08-20 09:05:08 PDT
Comment on
attachment 159333
[details]
Remove incorrect getBBox() code View in context:
https://bugs.webkit.org/attachment.cgi?id=159333&action=review
r=me, but...
> Source/WebCore/ChangeLog:9 > + SVGPathElement defines a getBBox() function that is both wrong and > + deadcode. This patch cleans this up.
I would agree that we should return objectBoundingBox(), but is does not seem to be "deadcode". Can you change this comment please?
Philip Rogers
Comment 9
2012-08-20 09:27:25 PDT
Created
attachment 159451
[details]
Update comment. @krit, good catch.
WebKit Review Bot
Comment 10
2012-08-20 12:52:31 PDT
Comment on
attachment 159451
[details]
Update comment. Clearing flags on attachment: 159451 Committed
r126056
: <
http://trac.webkit.org/changeset/126056
>
WebKit Review Bot
Comment 11
2012-08-20 12:52:35 PDT
All reviewed patches have been landed. Closing bug.
Mark Lam
Comment 12
2012-08-24 13:16:23 PDT
This change broke svg/custom/getBBox-path.svg on platform mac. See
https://bugs.webkit.org/show_bug.cgi?id=94969
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug