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

Categories

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

x86
Windows 7
defect

Tracking

()

People

(Reporter: khuey, Unassigned)

Details

(Keywords: assertion, testcase)

Attachments

(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 [message_loop.cc:220]
MessageLoop::RunHandler [message_loop.cc:203]
MessageLoop::Run [message_loop.cc:176]
nsBaseAppShell::Run [nsBaseAppShell.cpp:191]
nsAppStartup::Run [nsAppStartup.cpp:224]
XRE_main [nsAppRunner.cpp:3765]
main [nsBrowserApp.cpp:158]
libc.so.6 + 0x16bb6

This is because at http://hg.mozilla.org/mozilla-central/annotate/59771590e920/netwerk/base/src/nsIOService.cpp#l558 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.
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

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.