On Mon Jul 11 19:03:14 2022 +0000, Jacek Caban wrote:
There are two aspects of it. One is embedding API, with with loading must cooperate. It's especially important for the main document binding, which may in fact be initialized by things like BingToObject(). It's much less of an issue for XHR. The other aspect is what Gecko expects and the best way to learn that is in source code. Running tests with random changes may be an interesting observation, but does not prove much. In this case our implementation replaces original Gecko protocol implementation. An equivalent code would be: https://gitlab.winehq.org/wine/wine-gecko/-/blob/master/netwerk/protocol/htt... NS_SniffContent() call concept seems similar to urlmon MIME validation and it's controlled by LOAD_CALL_CONTENT_SNIFFERS, so maybe we could use that to decide on MIME source preference?
I see, it seems to be working by additionally gating it with the flag.
I tried to add some more tests without XHR along side "wrong" content type (compared to what's sniffed), and for normal images it works fine, but for some reason I couldn't get svg to work in native's <img> with our custom protocol handler (though it works fine if I navigate to it externally via IE as a normal file, same svg test file and all). It just kept aborting with E_ABORT, while it worked in Wine so I know it wasn't some mistake in the tests. But anyway I'll leave svg out for now.