Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / base / nsIObjectLoadingContent.idl
blobded79acd216dc6da73bba11709bae523f1e53754
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsIChannel;
9 interface nsIRequest;
10 interface nsIFrame;
11 interface nsIPluginTag;
12 interface nsIURI;
14 webidl BrowsingContext;
16 /**
17 * This interface represents a content node that loads objects.
19 * Please make sure to update the MozObjectLoadingContent WebIDL
20 * mixin to mirror this interface when changing it.
23 [scriptable, builtinclass, uuid(2eb3195e-3eea-4083-bb1d-d2d70fa35ccb)]
24 interface nsIObjectLoadingContent : nsISupports
26 /**
27 * See notes in nsObjectLoadingContent.h
29 const unsigned long TYPE_LOADING = 0;
30 const unsigned long TYPE_IMAGE = 1;
31 const unsigned long TYPE_FALLBACK = 2;
32 const unsigned long TYPE_FAKE_PLUGIN = 3;
33 const unsigned long TYPE_DOCUMENT = 4;
34 const unsigned long TYPE_NULL = 5;
36 const unsigned long PLUGIN_ACTIVE = 0xFF;
38 // Plugins-specific permission indicating that we want to prompt the user
39 // to decide whether they want to allow a plugin, but to do so in a less
40 // intrusive way than PROMPT_ACTION would entail. At the time of writing,
41 // this means hiding all in-content plugin overlays, but still showing the
42 // plugin badge in the URL bar.
43 const unsigned long PLUGIN_PERMISSION_PROMPT_ACTION_QUIET = 8;
45 /**
46 * The actual mime type (the one we got back from the network
47 * request) for the element.
49 readonly attribute ACString actualType;
51 /**
52 * Gets the type of the content that's currently loaded. See
53 * the constants above for the list of possible values.
55 readonly attribute unsigned long displayedType;
57 /**
58 * Gets the content type that corresponds to the give MIME type. See the
59 * constants above for the list of possible values. If nothing else fits,
60 * TYPE_FALLBACK will be returned.
62 unsigned long getContentTypeForMIMEType(in AUTF8String aMimeType);
64 /**
65 * Forces a re-evaluation and reload of the tag, optionally invalidating its
66 * click-to-play state. This can be used when the MIME type that provides a
67 * type has changed, for instance, to force the tag to re-evalulate the
68 * handler to use.
70 void reload(in boolean aClearActivation);
72 /**
73 * Puts the tag in the "waiting on a channel" state and adopts this
74 * channel. This does not override the normal logic of examining attributes
75 * and the channel type, so the load may cancel this channel if it decides not
76 * to use one.
78 * This assumes:
79 * - This tag has not begun loading yet
80 * - This channel has not yet hit OnStartRequest
81 * - The caller will continue to pass channel events to us as a listener
83 [noscript] void initializeFromChannel(in nsIRequest request);
85 /**
86 * The URL of the data/src loaded in the object. This may be null (i.e.
87 * an <embed> with no src).
89 readonly attribute nsIURI srcURI;
91 /**
92 * Disable the use of fake plugins and reload the tag if necessary.
94 void skipFakePlugins();
96 /**
97 * Switch the tag into the TYPE_DOCUMENT state, and returns the
98 * BrowsingContext which the load should complete in.
100 [noscript] BrowsingContext upgradeLoadToDocument(in nsIChannel channel);