Open Bug 652114 Opened 10 years ago Updated 2 years ago

ASSERTION: Bad URI: 'StringBeginsWith(aUri, NS_LITERAL_CSTRING(FILEDATA_SCHEME ":"))' with relative URI in a moz-filedata resource


(Core :: DOM: Core & HTML, defect, P5)

Windows 7




(Reporter: khuey, Unassigned)


(Keywords: assertion, testcase)


(1 file)

test_mozfiledataurl.html triggers

###!!! ASSERTION: Bad URI: 'StringBeginsWith(aUri, NS_LITERAL_CSTRING(FILEDATA_SCHEME ":"))', file ../../../../content/base/src/nsFileDataProtocolHandler.cpp, line 115
GetFileDataInfo [nsFileDataProtocolHandler.cpp:117]
nsFileDataProtocolHandler::NewURI [nsFileDataProtocolHandler.cpp:392]
nsIOService::NewURI [nsIOService.cpp:573]
NS_NewURI [nsNetUtil.h:175]
NS_NewURI [nsNetUtil.h:186]
nsHtml5TreeOpExecutor::ConvertIfNotPreloadedYet [nsHtml5TreeOpExecutor.cpp:854]
nsHtml5TreeOpExecutor::PreloadImage [nsHtml5TreeOpExecutor.cpp:896]
nsHtml5SpeculativeLoad::Perform [nsHtml5SpeculativeLoad.cpp:64]
nsHtml5TreeOpExecutor::FlushSpeculativeLoads [nsHtml5TreeOpExecutor.cpp:356]
nsHtml5LoadFlusher::Run [nsHtml5StreamParser.cpp:169]
nsThread::ProcessNextEvent [nsThread.cpp:618]
NS_ProcessNextEvent_P [nsThreadUtils.cpp:250]
mozilla::ipc::MessagePump::Run [MessagePump.cpp:110]
MessageLoop::RunInternal []
MessageLoop::RunHandler []
MessageLoop::Run []
nsBaseAppShell::Run [nsBaseAppShell.cpp:191]
nsAppStartup::Run [nsAppStartup.cpp:224]
XRE_main [nsAppRunner.cpp:3765]
main [nsBrowserApp.cpp:158] + 0x16bb6

This is because at we fail to extract the scheme (since there isn't one and we assume that the URI is relative).  Relative URIs don't make much sense in the context of the moz-filedata scheme (except for fragments of course).
So, I noticed that the IO service completely ignores URI_NORELATIVE ... is there a reason for that?
Simple patch, but it blows up the test suite.
Well, most simply jar: has URI_NORELATIVE set, which is just bogus.

But even worse, we want to allow (in the near future if it's not allowed now) resolving a string like '#foo' relative to any base URI, even one which has URI_NORELATIVE.  So the attached patch is wrong no matter what.  The protocol handler needs to deal here, or we need to make the IOservice allow through '#foo' (and then the protocol handler here still needs fixing) or something.

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.