Closed Bug 69453 Opened 24 years ago Closed 24 years ago

We need ability to disable and enable image loading "on-the-fly"

Categories

(Core Graveyard :: Embedding: APIs, defect, P4)

x86
Windows 98
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: bugz, Assigned: pavlov)

References

Details

We need ability to disable and enable image loading "on-the-fly". The client will initially disable image loading and proceed to load and render the document body. When the document is complete, the client and interpose any required processing, then enable image loading, and request the images. This will give us the ability to modify the DOM immediately after the body is loaded, rather than waiting until after the images have loaded.
Blocks: 64833
We need this on a per-top-level window basis. over to pavlov for suggestions. I should be able to call some method on nsIWebBrowser() like setImages(boolean).
Assignee: valeski → pavlov
Blocks: 70229
Keywords: embed, mozilla0.9
No longer blocks: 64833
Blocks: 64833
Keywords: embed
I will start work on this soon.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
is this needed for embedding ? if so, please add the keywords that are needed.
Target Milestone: mozilla0.9 → ---
Keywords: embed
it's needed by embedding. there are no embedding keywords (just meta bugs (as indicated)). the "embed" keyword is depricated and shouldn't even be on here (removing).
Keywords: embed
could a style element not be dynamically added to the document as it is being loaded like: img { display: none; } which would keep the image frames from being created and thus block the image loads. then remove the style rule and they would come in.
No, adding a stylesheet element would modify the content model which would screw up roundtripping, and would add unexpected DOM nodes into the DOM tree. We need an API to say images are turned off...
ok.. then should the embedding team provide some api for this for me to call to see if i can load an image or not? should this use the nsIContentPolicy stuff?
cc'ing shaver about nsIContentPolicy. nsIContentPolicy currently doesn't have per-top-leve-window policy querying capability, so we'd have to add that first. nsIWebBrowserSetup is currently our per-top-level-window content enable/disable iface, maybe you could add an attrib there. don't overlook that this is _per-window_, *not* global. Also, if you don't load an image on the first pass, can choose to load it later (as in, when the attrib got flipped)?
I don't really care how this is done, but someone is going to have to provide APIs for me to call with either a URL and/or a content node or frame and tell me if it can be loaded or not. Let me know where there are available APIs to do the check and I'll add code to call your APIs.
shaver, for me to do this, nsIContentPolicy needs to known about windows. Is there a bug filed on that?
Target Milestone: --- → mozilla0.9.1
Correction: Changing QA contact for the Embed API bugs to David Epstein.
QA Contact: mdunn → depstein
shaver?
Priority: -- → P4
so who is responsible for making nsIContentPolicy be window specific? shaver?
Blocks: 75664
Whiteboard: needed by 05/15/01
Reassigning to shaver. The image code to check nsIContentPolicy is written and checked in (if 0'd out since I was unable to find a good way to test it.) Additional things are needed here such as making nsIContentPolicy be window- aware.
Assignee: pavlov → shaver
Status: ASSIGNED → NEW
nsIContentPolicy doesn't need to know about per-window decisions, but whatever implements it does. I'm not yet clear enough on exactly how these decisions will be made (where does the data for the decision come from?) to do anything meaningful with this. I don't think nsIContentPolicy will need to change at all to accomodate this stuff, but I'm happy to adjust the interface if I'm wrong. Reassigning to gagan until I can get a clear description of how this feature will work.
Assignee: shaver → gagan
Pavlov: can you better describe your requirements for shaver?
I have no real requirements. If you don't want an image, then don't request it. This is handled in nsImageFrame in layout with checks to things like the security manager and nsIContentPolicy. beyond that, I don't know much else.
as I understand it, this is an embedding requirement. someone on embedding should know better I would think?
AFAIK there are 3 separate issues here-- 1. Imagelib needs to check nsIContentPolicy to see if images are switched on or off for this load. 2. nsIContentPolicy needs to be able to determine if images need to be loaded or not on a per window basis-- does so by being set by nsIWebBrowser[Setup](?) 3. nsIWebBrowser[Setup](?) needs a way to switch images off and on a global level. Bug for 1 is this one that Pavlov will own and has very little left to do (switch on an #if 0) I am going to file bug 2 which I think belongs with shaver and bug 3 would be valeski? So assigning this back to pavlov (and going to create bugs for #2 and #3)
Assignee: gagan → pavlov
adding dependencies...
Depends on: 81260, 81263
valeski removed the ifdefs in nsImageFrame... is the work here basically done now, or is there more left to do?
Whiteboard: needed by 05/15/01 → W
Whiteboard: W
I checked in the fixes for this yesterday. use nsIWebBrowserSetup to disable image loading in a particular window.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
image loading on per win basis. per verfs of 81260 & 81263, verifying this.
Status: RESOLVED → VERIFIED
No longer blocks: 64833
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.