Bug 32511 - Dragging an SVG image triggers assertion in DragController::startDrag()
Summary: Dragging an SVG image triggers assertion in DragController::startDrag()
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-12-14 05:34 PST by Andreas Kling
Modified: 2009-12-21 10:58 PST (History)
3 users (show)

See Also:

Add SVGImage::filenameExtension() (1.33 KB, patch)
2009-12-14 05:40 PST, Andreas Kling
darin: review-
Details | Formatted Diff | Diff
Add SVGImage::filenameExtension() + regression test (4.05 KB, patch)
2009-12-21 03:52 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2009-12-14 05:34:37 PST
DragController.cpp:675: ASSERT(!image->filenameExtension().isEmpty());

SVGImage doesn't implement filenameExtension(), and the default implementation returns an empty string.
Comment 1 Andreas Kling 2009-12-14 05:40:49 PST
Created attachment 44788 [details]
Add SVGImage::filenameExtension()
Comment 2 WebKit Review Bot 2009-12-14 05:41:48 PST
style-queue ran check-webkit-style on attachment 44788 [details] without any errors.
Comment 3 Darin Adler 2009-12-14 09:45:47 PST
Comment on attachment 44788 [details]
Add SVGImage::filenameExtension()

Thanks, looks like the right fix.

> +        virtual String filenameExtension() const;

Virtual functions like this one normally should be private rather than public. It's a programming error to call this function on a pointer known to be an SVGImage* so it's good to get a compiler error in that case. And a private member function still does just fine at overriding the base class.

Can we make a regression test for this? Normally we require regression tests for all bug fixes, and we have quite a few dragging tests already, so it can probably be done.

I'm going to say review-, but if you try and find we can't make a regression test then revise the ChangeLog to explain why, and then feel free to put this up for review again.
Comment 4 Andreas Kling 2009-12-21 03:52:02 PST
Created attachment 45319 [details]
Add SVGImage::filenameExtension() + regression test

Thanks for your comments!

Here's the same patch with an added regression test. Please note that the test will only fail when compiled in debug mode, since the problem is a failing assertion.
Comment 5 WebKit Review Bot 2009-12-21 03:55:56 PST
style-queue ran check-webkit-style on attachment 45319 [details] without any errors.
Comment 6 Andreas Kling 2009-12-21 05:09:00 PST
Minor brain glitch, it's not actually the *same* patch, I made SVGImage::filenameExtension() private as per your suggestion.
Comment 7 WebKit Commit Bot 2009-12-21 10:58:31 PST
Comment on attachment 45319 [details]
Add SVGImage::filenameExtension() + regression test

Clearing flags on attachment: 45319

Committed r52448: <http://trac.webkit.org/changeset/52448>
Comment 8 WebKit Commit Bot 2009-12-21 10:58:36 PST
All reviewed patches have been landed.  Closing bug.