Closed Bug 1202598 Opened 10 years ago Closed 10 years ago

DXR doesn't show SVG source in some cases

Categories

(Webtools Graveyard :: DXR, defect)

defect
Not set
normal

Tracking

(firefox43 affected)

RESOLVED FIXED
Tracking Status
firefox43 --- affected

People

(Reporter: Gijs, Assigned: new_one)

References

Details

Works: https://dxr.mozilla.org/mozilla-central/source/addon-sdk/source/test/fixtures/mofo_logo.SVG Doesn't work: https://dxr.mozilla.org/mozilla-central/source/browser/themes/windows/caption-buttons.svg MXR has the same problem, but at least there I can use "?raw=1" to get the raw file. That doesn't seem to work on DXR.
So it looks like replacing "source" with "raw" in the url path at least produces the file, though for SVG I still get an image rather than the source code - I can accel-u to view-source on that for now. It'd be really useful if we showed the SVG code rather than the image - many of the source tree images require target selectors (foo.svg#foo) to show anything at all because of the CSS in them, so right now we just show nothing.
What would you propose as the appropriate for the bug? Is it better to show the source instead of the image, to show both, or to make an easy link to the source? Aside, I think you identified another bug: .SVG should be handled the same was as .svg.
Flags: needinfo?(gijskruitbosch+bugs)
(In reply to Peter Elmers [:new_one] from comment #2) > What would you propose as the appropriate for the bug? .svg and .SVG files should show as syntax-highlighted source XML, rather than as images. They are searchable as such. > Is it better to show the source instead of the image, to show both, or to > make an easy link to the source? DXR's purpose is to search through source code. It cannot search through other images, but it can search through *the source* of SVG, and it should be able to display that source code. For this search, for instance: https://dxr.mozilla.org/mozilla-central/search?q=%22display%3A+initial%22+path%3Asvg&redirect=true&case=true the one result is: https://dxr.mozilla.org/mozilla-central/source/browser/themes/windows/caption-buttons.svg#10 and that should show the relevant line, not a blank page. The page is already trying to show the file as an image, that's exactly what's wrong. Many of the svgs we use only work when used with a #target in the URL, which will never be the case on DXR. If people want the image as-is, they can use the /raw/ version of the URL (which should be linked, yes, but isn't right now...). That is better than the other way around (ie show image for /source/, show syntax highlighting for /raw/) because it provides better consistency with other files (the result of /raw/ saved to disk is the same as what vcs gives you), and because you can then use the #target selector in the URL to show the individual components of the combined SVG file. Does that make sense?
Flags: needinfo?(gijskruitbosch+bugs)
Makes sense, and I've submitted a patch for it, https://github.com/mozilla/dxr/pull/472. Now there would be a link on the right to view the SVG as an image, which takes you to the /raw/ URL.
Assignee: nobody → peter.elmers
Commit pushed to master at https://github.com/mozilla/dxr https://github.com/mozilla/dxr/commit/f36c41e961ab411da8cb0e4d59f6b9257ee17a5c Display SVGs as XML, and add link to view as image. Fixes bug 1202598.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.