Open
Bug 314689
Opened 19 years ago
Updated 2 years ago
nsCSSLoader::Stop should cancel the necko channels
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
NEW
People
(Reporter: bzbarsky, Unassigned)
Details
Right now it just sets a flag to drop the sheet on the floor whenever necko actually cought up the data...
Reporter | ||
Comment 1•18 years ago
|
||
So given that we're using a streamloader, is there a way to do this?
Comment 2•18 years ago
|
||
well, you could get the channel from the streamloader and cancel that.
OS: Linux → All
Hardware: PC → All
Comment 3•18 years ago
|
||
what biesi said.
Reporter | ||
Comment 4•18 years ago
|
||
That won't work. See http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/netwerk/base/public/nsIUnicharStreamLoader.idl&rev=1.10&mark=108-109#108
I suppose we could change that aspect of streamloader behavior...
Comment 5•18 years ago
|
||
I think you should hold a reference to the loadgroup that the channel is added to so you can just cancel the loadgroup instead of canceling the channel directly. That will handle redirects automatically for you. Since you are setting up the stream loader, you can arrange to hold a reference to the loadgroup from the start.
Reporter | ||
Comment 6•18 years ago
|
||
Canceling the loadgroup will cancel all loads for the document, not just the stylesheet loads...
Granted, the common case of calling Stop() on the CSSLoader is when we're stopping loads for the document. But in that case this bug is already a non-issue.
Comment 7•18 years ago
|
||
Then use a separate LoadGroup for the CSS file and all of its dependencies? Stick that LoadGroup in the LoadGroup for the document?
Reporter | ||
Comment 8•18 years ago
|
||
That might work (have a separate loadgroup for the CSSLoader). The problem is knowing when to add it to the loadgroup for the document. Does calling AddRequest multiple times with the same request do the right thing?
Comment 9•18 years ago
|
||
No, you don't want to call AddRequest more than once.
Reporter | ||
Comment 10•18 years ago
|
||
I suppose I can ask my loadgroup whether it's in the document loadgroup... that might work.
Comment 11•18 years ago
|
||
Um... why do you need that? Why can't you just create a new loadgroup for each loader, and set the loadgroup's loadgroup to the document's loadgroup?
Comment 12•18 years ago
|
||
(the loadgroup takes care of adding itself to loadgroups, like all requests)
Reporter | ||
Comment 13•18 years ago
|
||
But a Stop() call would remove it....
I was planning on using a single loadgroup for the whole CSSLoader, basically. When starting a sheet load, add it to the document loadgroup if it's not already there, then add the sheet load to it.
Reporter | ||
Comment 14•18 years ago
|
||
Unless you mean a separate loadgroup for each _load_. In which case I have to keep track of them. And it seems like a waste...
Reporter | ||
Comment 15•18 years ago
|
||
Except that it seems that a document's loadgroup is possibly subject to change. :( So I do need to keep track of each load separately. :(
Also, there's the issue of creating a strong ref from document to document loadgroup, which we avoid right now, I believe...
QA Contact: ian → style-system
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•