[webkit-dev] Why the limited scope for preferredExtensionForImageSourceType?
mjs at apple.com
Thu Dec 11 12:16:39 PST 2008
On Dec 11, 2008, at 11:38 AM, Brent Fulgham wrote:
> A recent change added some tests in the dragging logic for valid file
> extension. The default Cairo implementation was set to return blank,
> which causes these various assertions to fire, rendering these
> operations unusable.
> It seems that most of the information necessary to determine expected
> file extension is present in the various decoders, but the mapping
> from UTI's to extensions was implemented deep in the guts of
> ImageSourceCGWin, rather than at some higher level.
> Is the "preferredExtensionForImageSourceType" function really Windows
> and CG-specific? These types and UTI's seem like they should be
> generally applicable.
> I would like to move this to at least ImageSource.cpp, so that the
> Cairo back-end could make use of the mapping.
> Does anyone know why the scope of this function was limited so
I think it is because we know exactly the types of images that CG can
decode, but this is not necessarily the same set as exists for all
other ports. In particular, the Mac port definitely supports a
different set, and Cairo-based ports likely use the image decoder
copies in the WebKit tree, which is yet another set. I think perhaps a
good solution would be to make the mechanism general, but populate the
mapping data separately for the different ports.
More information about the webkit-dev