Calling SVGImage::data() returns NULL. It should return the actual SVG data.
One way to repro is to run the Chromium webkit_unit_tests, more specifically WebPageNewSerializeTest,SVGImageDontCrash. webkit_unit_tests --gtest_filter=WebPageNewSerializeTest.SVGImageDontCrash In PageSerializer::addImageToResources() there is a LOG_ERROR that's printed when the SVG image content is missing.
Is there any user observable effect?
The only effect I am aware of is that MHTML generated for a page with SVG images will not include them (as it does not get the data).
@Jay, were you able to create a repro for this (even if just in c++)?
@Philip You can repro with the steps I described in comment #1. It's a unit-test that generate MHTML from a simple page with an SVG image.
It looks like the image returned from imageForRenderer() does not contain the copied data() but image->image()->data() does. I should have a patch up tomorrow for this.
Created attachment 170227 [details] First pass
Comment on attachment 170227 [details] First pass LGTM. Do we know if there is a way to test this with LayoutTests instead of just a Chromium Unit Test?
LGTM @eric We can't test that from a Layout test as page serialization cannot be triggered from a page.
Created attachment 170271 [details] Add back null check per Jay's request
Comment on attachment 170271 [details] Add back null check per Jay's request Rejecting attachment 170271 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1 ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://queues.webkit.org/results/14529170
Created attachment 170276 [details] Updating reviewer
Comment on attachment 170276 [details] Updating reviewer Clearing flags on attachment: 170276 Committed r132295: <http://trac.webkit.org/changeset/132295>
All reviewed patches have been landed. Closing bug.