nsIDocShell.idl 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "domstubs.idl"
  7. #include "nsIDocShellTreeItem.idl"
  8. #include "nsIRequest.idl"
  9. %{ C++
  10. #include "js/TypeDecls.h"
  11. class nsPresContext;
  12. class nsIPresShell;
  13. %}
  14. /**
  15. * The nsIDocShell interface.
  16. */
  17. [ptr] native nsPresContext(nsPresContext);
  18. [ptr] native nsIPresShell(nsIPresShell);
  19. interface nsIURI;
  20. interface nsIChannel;
  21. interface nsIContentViewer;
  22. interface nsIDOMEventTarget;
  23. interface nsIDocShellLoadInfo;
  24. interface nsIDocument;
  25. interface nsIEditor;
  26. interface nsIEditingSession;
  27. interface nsISimpleEnumerator;
  28. interface nsIInputStream;
  29. interface nsIRequest;
  30. interface nsISHEntry;
  31. interface nsILayoutHistoryState;
  32. interface nsISecureBrowserUI;
  33. interface nsIScriptGlobalObject;
  34. interface nsIStructuredCloneContainer;
  35. interface nsIDOMStorage;
  36. interface nsIPrincipal;
  37. interface nsIWebBrowserPrint;
  38. interface nsIPrivacyTransitionObserver;
  39. interface nsIReflowObserver;
  40. interface nsIScrollObserver;
  41. interface nsITabParent;
  42. interface nsITabChild;
  43. interface nsICommandManager;
  44. interface nsICommandParams;
  45. native TabChildRef(already_AddRefed<nsITabChild>);
  46. [scriptable, builtinclass, uuid(049234fe-da10-478b-bc5d-bc6f9a1ba63d)]
  47. interface nsIDocShell : nsIDocShellTreeItem
  48. {
  49. /**
  50. * Loads a given URI. This will give priority to loading the requested URI
  51. * in the object implementing this interface. If it can't be loaded here
  52. * however, the URL dispatcher will go through its normal process of content
  53. * loading.
  54. *
  55. * @param uri - The URI to load.
  56. * @param loadInfo - This is the extended load info for this load. This
  57. * most often will be null, but if you need to do
  58. * additional setup for this load you can get a loadInfo
  59. * object by calling createLoadInfo. Once you have this
  60. * object you can set the needed properties on it and
  61. * then pass it to loadURI.
  62. * @param aLoadFlags - Flags to modify load behaviour. Flags are defined in
  63. * nsIWebNavigation. Note that using flags outside
  64. * LOAD_FLAGS_MASK is only allowed if passing in a
  65. * non-null loadInfo. And even some of those might not
  66. * be allowed. Use at your own risk.
  67. */
  68. [noscript]void loadURI(in nsIURI uri,
  69. in nsIDocShellLoadInfo loadInfo,
  70. in unsigned long aLoadFlags,
  71. in boolean firstParty);
  72. /**
  73. * Loads a given stream. This will give priority to loading the requested
  74. * stream in the object implementing this interface. If it can't be loaded
  75. * here however, the URL dispatched will go through its normal process of
  76. * content loading.
  77. *
  78. * @param aStream - The input stream that provides access to the data
  79. * to be loaded. This must be a blocking, threadsafe
  80. * stream implementation.
  81. * @param aURI - The URI representing the stream, or null.
  82. * @param aContentType - The type (MIME) of data being loaded (empty if unknown).
  83. * @param aContentCharset - The charset of the data being loaded (empty if unknown).
  84. * @param aLoadInfo - This is the extended load info for this load. This
  85. * most often will be null, but if you need to do
  86. * additional setup for this load you can get a
  87. * loadInfo object by calling createLoadInfo. Once
  88. * you have this object you can set the needed
  89. * properties on it and then pass it to loadStream.
  90. */
  91. [noscript]void loadStream(in nsIInputStream aStream,
  92. in nsIURI aURI,
  93. in ACString aContentType,
  94. in ACString aContentCharset,
  95. in nsIDocShellLoadInfo aLoadInfo);
  96. const long INTERNAL_LOAD_FLAGS_NONE = 0x0;
  97. const long INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL = 0x1;
  98. const long INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 0x2;
  99. const long INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 0x4;
  100. // This flag marks the first load in this object
  101. // @see nsIWebNavigation::LOAD_FLAGS_FIRST_LOAD
  102. const long INTERNAL_LOAD_FLAGS_FIRST_LOAD = 0x8;
  103. const long INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10;
  104. const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20;
  105. // Whether the load should be treated as srcdoc load, rather than a URI one.
  106. const long INTERNAL_LOAD_FLAGS_IS_SRCDOC = 0x40;
  107. const long INTERNAL_LOAD_FLAGS_NO_OPENER = 0x100;
  108. // Whether a top-level data URI navigation is allowed for that load
  109. const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI = 0x200;
  110. // NB: 0x80 is available.
  111. /**
  112. * Loads the given URI. This method is identical to loadURI(...) except
  113. * that its parameter list is broken out instead of being packaged inside
  114. * of an nsIDocShellLoadInfo object...
  115. *
  116. * @param aURI - The URI to load.
  117. * @param aOriginalURI - The URI to set as the originalURI on the channel
  118. * that does the load. If null, aURI will be set as
  119. * the originalURI.
  120. * @param aLoadReplace - If set LOAD_REPLACE flag will be set on the
  121. * channel. aOriginalURI is null, this argument is
  122. * ignored.
  123. * @param aIsFromProcessingFrameAttributes
  124. * - If this is a load triggered by changing frame
  125. * attributes.
  126. * See nsILoadInfo.isFromProcessingFrameAttributes
  127. * @param aReferrer - Referring URI
  128. * @param aReferrerPolicy - Referrer policy
  129. * @param aTriggeringPrincipal - A non-null principal that initiated that load.
  130. * Please note that this is the principal that is
  131. * used for security checks. If the argument aURI
  132. * is provided by the web, then please do not pass
  133. * a SystemPrincipal as the triggeringPrincipal.
  134. * @param aPrincipalToInherit - Principal to be inherited for that load. If this
  135. * argument is null then principalToInherit is
  136. * computed as follows:
  137. * a) If INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL, and
  138. * aLoadType is not LOAD_NORMAL_EXTERNAL, and the
  139. * URI would normally inherit a principal, then
  140. * principalToInherit is set to the current
  141. * document's principal, or parent document if
  142. * there is not a current document.
  143. * b) If principalToInherit is still null (e.g. if
  144. * some of the conditions of (a) were not satisfied),
  145. * then no inheritance of any sort will happen: the
  146. * load will just get a principal based on the URI
  147. * being loaded.
  148. * @param aFlags - Any of the load flags defined within above.
  149. * @param aStopActiveDoc - Flag indicating whether loading the current
  150. * document should be stopped.
  151. * @param aWindowTarget - Window target for the load.
  152. * @param aTypeHint - A hint as to the content-type of the resulting
  153. * data. May be null or empty if no hint.
  154. * @param aFileName - Non-null when the link should be downloaded as
  155. the given filename.
  156. * @param aPostDataStream - Post data stream (if POSTing)
  157. * @param aHeadersStream - Stream containing "extra" request headers...
  158. * @param aLoadFlags - Flags to modify load behaviour. Flags are defined
  159. * in nsIWebNavigation.
  160. * @param aSHEntry - Active Session History entry (if loading from SH)
  161. * @param aSrcdoc When INTERNAL_LOAD_FLAGS_IS_SRCDOC is set, the
  162. * contents of this parameter will be loaded instead
  163. * of aURI.
  164. * @param aSourceDocShell - The source browsing context for the navigation.
  165. * @param aBaseURI - The base URI to be used for the load. Set in
  166. * srcdoc loads as it cannot otherwise be inferred
  167. * in certain situations such as view-source.
  168. */
  169. [noscript]void internalLoad(in nsIURI aURI,
  170. in nsIURI aOriginalURI,
  171. in boolean aLoadReplace,
  172. in boolean aIsFromProcessingFrameAttributes,
  173. in nsIURI aReferrer,
  174. in unsigned long aReferrerPolicy,
  175. in nsIPrincipal aTriggeringPrincipal,
  176. in nsIPrincipal aPrincipalToInherit,
  177. in uint32_t aFlags,
  178. in AString aWindowTarget,
  179. in string aTypeHint,
  180. in AString aFileName,
  181. in nsIInputStream aPostDataStream,
  182. in nsIInputStream aHeadersStream,
  183. in unsigned long aLoadFlags,
  184. in nsISHEntry aSHEntry,
  185. in boolean firstParty,
  186. in AString aSrcdoc,
  187. in nsIDocShell aSourceDocShell,
  188. in nsIURI aBaseURI,
  189. out nsIDocShell aDocShell,
  190. out nsIRequest aRequest);
  191. /**
  192. * Do either a history.pushState() or history.replaceState() operation,
  193. * depending on the value of aReplace.
  194. */
  195. [implicit_jscontext]
  196. void addState(in jsval aData, in DOMString aTitle,
  197. in DOMString aURL, in boolean aReplace);
  198. /**
  199. * Helper for addState and document.open that does just the
  200. * history-manipulation guts.
  201. *
  202. * Arguments the spec defines:
  203. *
  204. * @param aDocument the document we're manipulating. This will get the new URI.
  205. * @param aNewURI the new URI.
  206. * @param aData The serialized state data. May be null.
  207. * @param aTitle The new title. May be empty.
  208. * @param aReplace whether this should replace the exising SHEntry.
  209. *
  210. * Arguments we need internally because deriving them from the
  211. * others is a bit complicated:
  212. *
  213. * @param aCurrentURI the current URI we're working with. Might be null.
  214. * @param aEqualURIs whether the two URIs involved are equal.
  215. */
  216. [nostdcall]
  217. void updateURLAndHistory(in nsIDocument aDocument, in nsIURI aNewURI,
  218. in nsIStructuredCloneContainer aData, in AString aTitle,
  219. in boolean aReplace, in nsIURI aCurrentURI,
  220. in boolean aEqualURIs);
  221. /**
  222. * Creates a DocShellLoadInfo object that you can manipulate and then pass
  223. * to loadURI.
  224. */
  225. void createLoadInfo(out nsIDocShellLoadInfo loadInfo);
  226. /**
  227. * Reset state to a new content model within the current document and the document
  228. * viewer. Called by the document before initiating an out of band document.write().
  229. */
  230. void prepareForNewContentModel();
  231. /**
  232. * For editors and suchlike who wish to change the URI associated with the
  233. * document. Note if you want to get the current URI, use the read-only
  234. * property on nsIWebNavigation.
  235. */
  236. void setCurrentURI(in nsIURI aURI);
  237. /**
  238. * Notify the associated content viewer and all child docshells that they are
  239. * about to be hidden. If |isUnload| is true, then the document is being
  240. * unloaded as well.
  241. *
  242. * @param isUnload if true, fire the unload event in addition to the pagehide
  243. * event.
  244. */
  245. [noscript] void firePageHideNotification(in boolean isUnload);
  246. /**
  247. * Presentation context for the currently loaded document. This may be null.
  248. */
  249. [noscript] readonly attribute nsPresContext presContext;
  250. /**
  251. * Presentation shell for the currently loaded document. This may be null.
  252. */
  253. [noscript,notxpcom] nsIPresShell GetPresShell();
  254. /**
  255. * Presentation shell for the oldest document, if this docshell is
  256. * currently transitioning between documents.
  257. */
  258. [noscript] readonly attribute nsIPresShell eldestPresShell;
  259. /**
  260. * Content Viewer that is currently loaded for this DocShell. This may
  261. * change as the underlying content changes.
  262. */
  263. readonly attribute nsIContentViewer contentViewer;
  264. /**
  265. * This attribute allows chrome to tie in to handle DOM events that may
  266. * be of interest to chrome.
  267. */
  268. attribute nsIDOMEventTarget chromeEventHandler;
  269. /**
  270. * This allows chrome to set a custom User agent on a specific docshell
  271. */
  272. attribute DOMString customUserAgent;
  273. /**
  274. * Whether to allow plugin execution
  275. */
  276. attribute boolean allowPlugins;
  277. /**
  278. * Whether to allow Javascript execution
  279. */
  280. attribute boolean allowJavascript;
  281. /**
  282. * Attribute stating if refresh based redirects can be allowed
  283. */
  284. attribute boolean allowMetaRedirects;
  285. /**
  286. * Attribute stating if it should allow subframes (framesets/iframes) or not
  287. */
  288. attribute boolean allowSubframes;
  289. /**
  290. * Attribute stating whether or not images should be loaded.
  291. */
  292. attribute boolean allowImages;
  293. /**
  294. * Attribute stating whether or not media (audio/video) should be loaded.
  295. */
  296. [infallible] attribute boolean allowMedia;
  297. /**
  298. * Attribute that determines whether DNS prefetch is allowed for this subtree
  299. * of the docshell tree. Defaults to true. Setting this will make it take
  300. * effect starting with the next document loaded in the docshell.
  301. */
  302. attribute boolean allowDNSPrefetch;
  303. /**
  304. * Attribute that determines whether window control (move/resize) is allowed.
  305. */
  306. attribute boolean allowWindowControl;
  307. /**
  308. * True if the docshell allows its content to be handled by a content listener
  309. * other than the docshell itself, including the external helper app service,
  310. * and false otherwise. Defaults to true.
  311. */
  312. [infallible] attribute boolean allowContentRetargeting;
  313. /**
  314. * True if new child docshells should allow content retargeting.
  315. * Setting allowContentRetargeting also overwrites this value.
  316. */
  317. [infallible] attribute boolean allowContentRetargetingOnChildren;
  318. /**
  319. * True if this docShell should inherit the private browsing ID from
  320. * its parent when reparented.
  321. *
  322. * NOTE: This should *not* be set false in new code, or for docShells
  323. * inserted anywhere other than as children of panels.
  324. */
  325. [infallible] attribute boolean inheritPrivateBrowsingId;
  326. /**
  327. * Get an enumerator over this docShell and its children.
  328. *
  329. * @param aItemType - Only include docShells of this type, or if typeAll,
  330. * include all child shells.
  331. * Uses types from nsIDocShellTreeItem.
  332. * @param aDirection - Whether to enumerate forwards or backwards.
  333. */
  334. const long ENUMERATE_FORWARDS = 0;
  335. const long ENUMERATE_BACKWARDS = 1;
  336. nsISimpleEnumerator getDocShellEnumerator(in long aItemType,
  337. in long aDirection);
  338. /**
  339. * The type of application that created this window
  340. */
  341. const unsigned long APP_TYPE_UNKNOWN = 0;
  342. const unsigned long APP_TYPE_MAIL = 1;
  343. const unsigned long APP_TYPE_EDITOR = 2;
  344. attribute unsigned long appType;
  345. /**
  346. * certain dochshells (like the message pane)
  347. * should not throw up auth dialogs
  348. * because it can act as a password trojan
  349. */
  350. attribute boolean allowAuth;
  351. /**
  352. * Set/Get the document scale factor. When setting this attribute, a
  353. * NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations
  354. * not supporting zoom. Implementations not supporting zoom should return
  355. * 1.0 all the time for the Get operation. 1.0 by the way is the default
  356. * of zoom. This means 100% of normal scaling or in other words normal size
  357. * no zoom.
  358. */
  359. attribute float zoom;
  360. /*
  361. * The size, in CSS pixels, of the horizontal margins for the <body> of an
  362. * HTML document in this docshel; used to implement the marginwidth attribute
  363. * on HTML <frame>/<iframe> elements. A value smaller than zero indicates
  364. * that the attribute was not set.
  365. */
  366. attribute long marginWidth;
  367. /*
  368. * The size, in CSS pixels, of the vertical margins for the <body> of an HTML
  369. * document in this docshel; used to implement the marginheight attribute on
  370. * HTML <frame>/<iframe> elements. A value smaller than zero indicates that
  371. * the attribute was not set.
  372. */
  373. attribute long marginHeight;
  374. /*
  375. * Tells the docshell to offer focus to its tree owner.
  376. * This is currently only necessary for embedding chrome.
  377. * If forDocumentNavigation is true, then document navigation should be
  378. * performed, where only the root of documents are selected. Otherwise, the
  379. * next element in the parent should be returned. Returns true if focus was
  380. * successfully taken by the tree owner.
  381. */
  382. bool tabToTreeOwner(in boolean forward, in boolean forDocumentNavigation);
  383. /**
  384. * Current busy state for DocShell
  385. */
  386. const unsigned long BUSY_FLAGS_NONE = 0;
  387. const unsigned long BUSY_FLAGS_BUSY = 1;
  388. const unsigned long BUSY_FLAGS_BEFORE_PAGE_LOAD = 2;
  389. const unsigned long BUSY_FLAGS_PAGE_LOADING = 4;
  390. /**
  391. * Load commands for the document
  392. */
  393. const unsigned long LOAD_CMD_NORMAL = 0x1; // Normal load
  394. const unsigned long LOAD_CMD_RELOAD = 0x2; // Reload
  395. const unsigned long LOAD_CMD_HISTORY = 0x4; // Load from history
  396. const unsigned long LOAD_CMD_PUSHSTATE = 0x8; // History.pushState()
  397. readonly attribute unsigned long busyFlags;
  398. /*
  399. * attribute to access the loadtype for the document
  400. */
  401. attribute unsigned long loadType;
  402. /*
  403. * Default load flags (as defined in nsIRequest) that will be set on all
  404. * requests made by this docShell and propagated to all child docShells and
  405. * to nsILoadGroup::defaultLoadFlags for the docShell's loadGroup.
  406. * Default is no flags. Once set, only future requests initiated by the
  407. * docShell are affected, so in general, these flags should be set before
  408. * the docShell loads any content.
  409. */
  410. attribute nsLoadFlags defaultLoadFlags;
  411. /*
  412. * returns true if the docshell is being destroyed, false otherwise
  413. */
  414. boolean isBeingDestroyed();
  415. /*
  416. * Returns true if the docshell is currently executing the onLoad Handler
  417. */
  418. readonly attribute boolean isExecutingOnLoadHandler;
  419. attribute nsILayoutHistoryState layoutHistoryState;
  420. readonly attribute boolean shouldSaveLayoutState;
  421. /**
  422. * The SecureBrowserUI object for this docshell. This is set by XUL
  423. * <browser> or nsWebBrowser for their root docshell.
  424. */
  425. attribute nsISecureBrowserUI securityUI;
  426. /**
  427. * Cancel the XPCOM timers for each meta-refresh URI in this docshell,
  428. * and this docshell's children, recursively. The meta-refresh timers can be
  429. * restarted using resumeRefreshURIs(). If the timers are already suspended,
  430. * this has no effect.
  431. */
  432. void suspendRefreshURIs();
  433. /**
  434. * Restart the XPCOM timers for each meta-refresh URI in this docshell,
  435. * and this docshell's children, recursively. If the timers are already
  436. * running, this has no effect.
  437. */
  438. void resumeRefreshURIs();
  439. /**
  440. * Begin firing WebProgressListener notifications for restoring a page
  441. * presentation. |viewer| is the content viewer whose document we are
  442. * starting to load. If null, it defaults to the docshell's current content
  443. * viewer, creating one if necessary. |top| should be true for the toplevel
  444. * docshell that is being restored; it will be set to false when this method
  445. * is called for child docshells. This method will post an event to
  446. * complete the simulated load after returning to the event loop.
  447. */
  448. void beginRestore(in nsIContentViewer viewer, in boolean top);
  449. /**
  450. * Finish firing WebProgressListener notifications and DOM events for
  451. * restoring a page presentation. This should only be called via
  452. * beginRestore().
  453. */
  454. void finishRestore();
  455. /* Track whether we're currently restoring a document presentation. */
  456. readonly attribute boolean restoringDocument;
  457. /* attribute to access whether error pages are enabled */
  458. attribute boolean useErrorPages;
  459. /**
  460. * Display a load error in a frame while keeping that frame's currentURI
  461. * pointing correctly to the page where the error ocurred, rather than to
  462. * the error document page. You must provide either the aURI or aURL parameter.
  463. *
  464. * @param aError The error code to be displayed
  465. * @param aURI nsIURI of the page where the error happened
  466. * @param aURL wstring of the page where the error happened
  467. * @param aFailedChannel The channel related to this error
  468. *
  469. * Returns whether or not we displayed an error page (note: will always
  470. * return false if in-content error pages are disabled!)
  471. */
  472. boolean displayLoadError(in nsresult aError,
  473. in nsIURI aURI,
  474. in wstring aURL,
  475. [optional] in nsIChannel aFailedChannel);
  476. /**
  477. * The channel that failed to load and resulted in an error page.
  478. * May be null. Relevant only to error pages.
  479. */
  480. readonly attribute nsIChannel failedChannel;
  481. /**
  482. * Keeps track of the previous SHTransaction index and the current
  483. * SHTransaction index at the time that the doc shell begins to load.
  484. * Used for ContentViewer eviction.
  485. */
  486. readonly attribute long previousTransIndex;
  487. readonly attribute long loadedTransIndex;
  488. /**
  489. * Notification that entries have been removed from the beginning of a
  490. * nsSHistory which has this as its rootDocShell.
  491. *
  492. * @param numEntries - The number of entries removed
  493. */
  494. void historyPurged(in long numEntries);
  495. /*
  496. * @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead.
  497. *
  498. * Retrieves the WebApps session storage object for the supplied principal.
  499. *
  500. * @param principal returns a storage for this principal
  501. * @param documentURI new storage will be created with reference to this
  502. * document.documentURI that will appear in storage event
  503. * @param create If true and a session storage object doesn't
  504. * already exist, a new one will be created.
  505. */
  506. nsIDOMStorage getSessionStorageForPrincipal(in nsIPrincipal principal,
  507. in DOMString documentURI,
  508. in boolean create);
  509. /*
  510. * @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead.
  511. *
  512. * Add a WebApps session storage object to the docshell.
  513. *
  514. * @param principal the principal the storage object is associated with
  515. * @param storage the storage object to add
  516. */
  517. void addSessionStorage(in nsIPrincipal principal, in nsIDOMStorage storage);
  518. /**
  519. * Gets the channel for the currently loaded document, if any.
  520. * For a new document load, this will be the channel of the previous document
  521. * until after OnLocationChange fires.
  522. */
  523. readonly attribute nsIChannel currentDocumentChannel;
  524. /**
  525. * Set the offset of this child in its container.
  526. */
  527. [noscript] void setChildOffset(in unsigned long offset);
  528. /**
  529. * Find out whether the docshell is currently in the middle of a page
  530. * transition. This is set just before the pagehide/unload events fire.
  531. */
  532. readonly attribute boolean isInUnload;
  533. /**
  534. * Find out if the currently loaded document came from a suspicious channel
  535. * (such as a JAR channel where the server-returned content type isn't a
  536. * known JAR type).
  537. */
  538. readonly attribute boolean channelIsUnsafe;
  539. /**
  540. * This attribute determines whether Mixed Active Content is loaded on the
  541. * document. When it is true, mixed active content was not blocked and has
  542. * loaded (or is about to load) on the page. When it is false, mixed active content
  543. * has not loaded on the page, either because there was no mixed active content
  544. * requests on the page or such requests were blocked by nsMixedContentBlocker.
  545. * This boolean is set to true in nsMixedContentBlocker if Mixed Active Content
  546. * is allowed (either explicitly on the page by the user or when the about:config
  547. * setting security.mixed_content.block_active_content is set to false).
  548. */
  549. [infallible] readonly attribute boolean hasMixedActiveContentLoaded;
  550. /**
  551. * This attribute determines whether a document has Mixed Active Content
  552. * that has been blocked from loading. When it is true, there is definitely
  553. * mixed active content on a page that has been blocked by
  554. * nsMixedContentBlocker. When it is false, there may or may not be mixed
  555. * active content on a page, but if there is, it will load. Note that if the
  556. * about:config setting security.mixed_content.block_active_content is set
  557. * false, this boolean will be false, since blocking active content has been
  558. * disabled.
  559. */
  560. [infallible] readonly attribute boolean hasMixedActiveContentBlocked;
  561. /**
  562. * This attribute determines whether Mixed Display Content is loaded on the
  563. * document. When it is true, mixed display content was not blocked and has
  564. * loaded (or is about to load) on the page. Similar behavior to
  565. * hasMixedActiveContentLoaded.
  566. */
  567. [infallible] readonly attribute boolean hasMixedDisplayContentLoaded;
  568. /**
  569. * This attribute determines whether a document has Mixed Display Content
  570. * that has been blocked from loading. Similar behavior to
  571. * hasMixedActiveContentBlocked.
  572. */
  573. [infallible] readonly attribute boolean hasMixedDisplayContentBlocked;
  574. /**
  575. * This attribute determines whether a document has Tracking Content
  576. * that has been blocked from loading.
  577. */
  578. [infallible] readonly attribute boolean hasTrackingContentBlocked;
  579. /**
  580. * This attribute determines whether Tracking Content is loaded on the
  581. * document. When it is true, tracking content was not blocked and has
  582. * loaded (or is about to load) on the page.
  583. */
  584. [infallible] readonly attribute boolean hasTrackingContentLoaded;
  585. /**
  586. * Disconnects this docshell's editor from its window, and stores the
  587. * editor data in the open document's session history entry. This
  588. * should be called only during page transitions.
  589. */
  590. [noscript, notxpcom] void DetachEditorFromWindow();
  591. /**
  592. * If true, this browser is not visible in the traditional sense, but
  593. * is actively being rendered to the screen (ex. painted on a canvas)
  594. * and should be treated accordingly.
  595. **/
  596. attribute boolean isOffScreenBrowser;
  597. /**
  598. * If the current content viewer isn't initialized for print preview,
  599. * it is replaced with one which is and to which an about:blank document
  600. * is loaded.
  601. */
  602. readonly attribute nsIWebBrowserPrint printPreview;
  603. /**
  604. * Whether this docshell can execute scripts based on its hierarchy.
  605. * The rule of thumb here is that we disable js if this docshell or any
  606. * of its parents disallow scripting.
  607. */
  608. [infallible] readonly attribute boolean canExecuteScripts;
  609. /**
  610. * Sets whether a docshell is active. An active docshell is one that is
  611. * visible, and thus is not a good candidate for certain optimizations
  612. * like image frame discarding. Docshells are active unless told otherwise.
  613. */
  614. attribute boolean isActive;
  615. /**
  616. * Puts the docshell in prerendering mode. noscript because we want only
  617. * native code to be able to put a docshell in prerendering.
  618. */
  619. [noscript] void SetIsPrerendered();
  620. /**
  621. * Whether this docshell is in prerender mode.
  622. */
  623. [infallible] readonly attribute boolean isPrerendered;
  624. /**
  625. * The ID of the docshell in the session history.
  626. */
  627. readonly attribute unsigned long long historyID;
  628. /**
  629. * Sets whether a docshell is an app tab. An app tab docshell may behave
  630. * differently than a non-app tab docshell in some cases, such as when
  631. * handling link clicks. Docshells are not app tabs unless told otherwise.
  632. */
  633. attribute boolean isAppTab;
  634. /**
  635. * Create a new about:blank document and content viewer.
  636. * @param aPrincipal the principal to use for the new document.
  637. */
  638. void createAboutBlankContentViewer(in nsIPrincipal aPrincipal);
  639. /**
  640. * Upon getting, returns the canonical encoding label of the document
  641. * currently loaded into this docshell.
  642. *
  643. * Upon setting, sets forcedCharset for compatibility with legacy callers.
  644. */
  645. attribute ACString charset;
  646. /**
  647. * Called when the user chose an encoding override from the character
  648. * encoding menu. Separate from the setter for the charset property to avoid
  649. * extensions adding noise to the data.
  650. */
  651. void gatherCharsetMenuTelemetry();
  652. /**
  653. * The charset forced by the user.
  654. */
  655. attribute ACString forcedCharset;
  656. /**
  657. * In a child docshell, this is the charset of the parent docshell
  658. */
  659. [noscript, notxpcom, nostdcall] void setParentCharset(
  660. in ACString parentCharset,
  661. in int32_t parentCharsetSource,
  662. in nsIPrincipal parentCharsetPrincipal);
  663. [noscript, notxpcom, nostdcall] void getParentCharset(
  664. out ACString parentCharset,
  665. out int32_t parentCharsetSource,
  666. out nsIPrincipal parentCharsetPrincipal);
  667. /**
  668. * Whether the docShell records profile timeline markers at the moment
  669. */
  670. [infallible] attribute boolean recordProfileTimelineMarkers;
  671. /**
  672. * Return a DOMHighResTimeStamp representing the number of
  673. * milliseconds from an arbitrary point in time. The reference
  674. * point is shared by all DocShells and is also used by timestamps
  675. * on markers.
  676. */
  677. DOMHighResTimeStamp now();
  678. /**
  679. * Returns and flushes the profile timeline markers gathered by the docShell
  680. */
  681. [implicit_jscontext]
  682. jsval popProfileTimelineMarkers();
  683. /**
  684. * Add an observer to the list of parties to be notified when this docshell's
  685. * private browsing status is changed. |obs| must support weak references.
  686. */
  687. void addWeakPrivacyTransitionObserver(in nsIPrivacyTransitionObserver obs);
  688. /**
  689. * Add an observer to the list of parties to be notified when reflows are
  690. * occurring. |obs| must support weak references.
  691. */
  692. void addWeakReflowObserver(in nsIReflowObserver obs);
  693. /**
  694. * Remove an observer from the list of parties to be notified about reflows.
  695. */
  696. void removeWeakReflowObserver(in nsIReflowObserver obs);
  697. /**
  698. * Notify all attached observers that a reflow has just occurred.
  699. *
  700. * @param interruptible if true, the reflow was interruptible.
  701. * @param start timestamp when reflow started, in milliseconds since
  702. * navigationStart (accurate to 1/1000 of a ms)
  703. * @param end timestamp when reflow ended, in milliseconds since
  704. * navigationStart (accurate to 1/1000 of a ms)
  705. */
  706. [noscript] void notifyReflowObservers(in bool interruptible,
  707. in DOMHighResTimeStamp start,
  708. in DOMHighResTimeStamp end);
  709. /**
  710. * Add an observer to the list of parties to be notified when scroll position
  711. * of some elements is changed.
  712. */
  713. [noscript] void addWeakScrollObserver(in nsIScrollObserver obs);
  714. /**
  715. * Add an observer to the list of parties to be notified when scroll position
  716. * of some elements is changed.
  717. */
  718. [noscript] void removeWeakScrollObserver(in nsIScrollObserver obs);
  719. /**
  720. * Notify all attached observers that the scroll position of some element
  721. * has changed.
  722. */
  723. [noscript] void notifyScrollObservers();
  724. /**
  725. * Returns true iff the docshell corresponds to an <iframe mozapp>.
  726. */
  727. [infallible] readonly attribute boolean isApp;
  728. /**
  729. * The type of iframe that this docshell lives.
  730. */
  731. const unsigned long FRAME_TYPE_REGULAR = 0;
  732. const unsigned long FRAME_TYPE_BROWSER = 1;
  733. const unsigned long FRAME_TYPE_APP = 2;
  734. [infallible] attribute unsigned long frameType;
  735. /**
  736. * Returns true if this docshell corresponds to an <iframe mozbrowser> or
  737. * <iframe mozapp>. <xul:browser> returns false here.
  738. */
  739. [infallible] readonly attribute boolean isMozBrowserOrApp;
  740. /**
  741. * Returns true if this docshell corresponds to an isolated <iframe
  742. * mozbrowser>.
  743. *
  744. * <iframe mozbrowser mozapp> and <xul:browser> are not considered to be
  745. * mozbrowser elements. <iframe mozbrowser noisolation> does not count as
  746. * isolated since isolation is disabled. Isolation can only be disabled if
  747. * the containing document is chrome.
  748. */
  749. [infallible] readonly attribute boolean isIsolatedMozBrowserElement;
  750. /**
  751. * Returns true if this docshell corresponds to an isolated <iframe
  752. * mozbrowser> or if the docshell is contained in an isolated <iframe
  753. * mozbrowser>.
  754. *
  755. * <iframe mozbrowser mozapp> and <xul:browser> are not considered to be
  756. * mozbrowser elements. <iframe mozbrowser noisolation> does not count as
  757. * isolated since isolation is disabled. Isolation can only be disabled if
  758. * the containing document is chrome.
  759. *
  760. * Our notion here of "contained in" means: Walk up the docshell hierarchy in
  761. * this process until we hit an <iframe mozapp> or <iframe mozbrowser> (or
  762. * until the hierarchy ends). Return true iff the docshell we stopped on has
  763. * isIsolatedMozBrowserElement == true.
  764. */
  765. [infallible] readonly attribute boolean isInIsolatedMozBrowserElement;
  766. /**
  767. * Returns true if this docshell corresponds to an <iframe mozbrowser> or
  768. * <iframe mozapp>, or if this docshell is contained in an <iframe mozbrowser>
  769. * or <iframe mozapp>. <xul:browser> returns false here.
  770. *
  771. * To compute this value, we walk up the docshell hierarchy. If we encounter
  772. * a docshell with isMozBrowserOrApp before we hit the end of the hierarchy,
  773. * we return true. Otherwise, we return false.
  774. */
  775. [infallible] readonly attribute boolean isInMozBrowserOrApp;
  776. /**
  777. * Returns true if this docshell is the top level content docshell.
  778. */
  779. [infallible] readonly attribute boolean isTopLevelContentDocShell;
  780. /**
  781. * Returns the id of the app associated with this docshell. If this docshell
  782. * is an <iframe mozbrowser> inside an <iframe mozapp>, we return the app's
  783. * appId.
  784. *
  785. * We compute this value by walking up the docshell hierarchy until we find a
  786. * docshell on which origin attributes was set. (ignoring those docshells
  787. * where x == UNKNOWN_APP_ID). We return the app id x.
  788. *
  789. * If we don't find a docshell with an associated app id in our hierarchy, we
  790. * return NO_APP_ID. We never return UNKNOWN_APP_ID.
  791. *
  792. * Notice that a docshell may have an associated app even if it returns true
  793. * for isBrowserElement!
  794. */
  795. [infallible] readonly attribute unsigned long appId;
  796. /**
  797. * Return the manifest URL of the app associated with this docshell.
  798. *
  799. * If there is no associated app in our hierarchy, we return empty string.
  800. */
  801. readonly attribute DOMString appManifestURL;
  802. /**
  803. * Like nsIDocShellTreeItem::GetSameTypeParent, except this ignores <iframe
  804. * mozbrowser> and <iframe mozapp> boundaries.
  805. */
  806. nsIDocShell getSameTypeParentIgnoreBrowserAndAppBoundaries();
  807. /**
  808. * Like nsIDocShellTreeItem::GetSameTypeRootTreeItem, except this ignores
  809. * <iframe mozbrowser> and <iframe mozapp> boundaries.
  810. */
  811. nsIDocShell getSameTypeRootTreeItemIgnoreBrowserAndAppBoundaries();
  812. /**
  813. * True iff asynchronous panning and zooming is enabled for this
  814. * docshell.
  815. */
  816. readonly attribute bool asyncPanZoomEnabled;
  817. /**
  818. * The sandbox flags on the docshell. These reflect the value of the sandbox
  819. * attribute of the associated IFRAME or CSP-protectable content, if
  820. * existent. See the HTML5 spec for more details.
  821. * These flags on the docshell reflect the current state of the sandbox
  822. * attribute, which is modifiable. They are only used when loading new
  823. * content, sandbox flags are also immutably set on the document when it is
  824. * loaded.
  825. * The sandbox flags of a document depend on the sandbox flags on its
  826. * docshell and of its parent document, if any.
  827. * See nsSandboxFlags.h for the possible flags.
  828. */
  829. attribute unsigned long sandboxFlags;
  830. /**
  831. * When a new browsing context is opened by a sandboxed document, it needs to
  832. * keep track of the browsing context that opened it, so that it can be
  833. * navigated by it. This is the "one permitted sandboxed navigator".
  834. */
  835. attribute nsIDocShell onePermittedSandboxedNavigator;
  836. /**
  837. * Returns true if we are sandboxed from aTargetDocShell.
  838. * aTargetDocShell - the browsing context we are attempting to navigate.
  839. */
  840. [noscript,notxpcom,nostdcall] bool isSandboxedFrom(in nsIDocShell aTargetDocShell);
  841. /**
  842. * This member variable determines whether a document has Mixed Active Content that
  843. * was initially blocked from loading, but the user has choosen to override the
  844. * block and allow the content to load. mMixedContentChannel is set to the document's
  845. * channel when the user allows mixed content. The nsMixedContentBlocker content policy
  846. * checks if the document's root channel matches the mMixedContentChannel. If it matches,
  847. * then Mixed Content is loaded. If it does match, mixed content is blocked.
  848. *
  849. * A match implies that there is definitely mixed active content on a page that was
  850. * initially blocked by nsMixedContentBlocker and then allowed and loaded by the user.
  851. * A miss imples that IF there is mixed active content on the page AND it was
  852. * blocked by nsMixedContentBlocker.cpp, the user has not choosen to override
  853. * the block. Note that if the about:config setting
  854. * security.mixed_content.block_active_content is set to false, this boolean
  855. * will be false, mMixedContentChannel will remain null since blocking active content has
  856. * been disabled and hence mMixedContentChannel will never be set.
  857. */
  858. attribute nsIChannel mixedContentChannel;
  859. /**
  860. * Checks whether the channel associated with the root docShell is equal to
  861. * mMixedContentChannel. If they are the same, allowMixedContent is set to true.
  862. * Checks if the root document has a secure connection. If it is, sets
  863. * rootHasSecureConnection to true. If the docShell is the root doc shell,
  864. * isRootDocShell is set to true.
  865. */
  866. void GetAllowMixedContentAndConnectionData(out boolean rootHasSecureConnection, out boolean allowMixedContent, out boolean isRootDocShell);
  867. /**
  868. * Are plugins allowed in the current document loaded in this docshell ?
  869. * (if there is one). This depends on whether plugins are allowed by this
  870. * docshell itself or if the document is sandboxed and hence plugins should
  871. * not be allowed.
  872. */
  873. [noscript, notxpcom] bool pluginsAllowedInCurrentDoc();
  874. /**
  875. * Attribute that determines whether fullscreen is allowed to be entered for
  876. * this subtree of the docshell tree. This is true when all iframes containing
  877. * this docshell have their "allowfullscreen" attribute set to "true".
  878. * fullscreenAllowed is only writable at content boundaries, where it is used
  879. * to propagate the value of the cross process parent's iframe's
  880. * "allowfullscreen" attribute to the child process. Setting
  881. * fullscreenAllowed on docshells which aren't content boundaries throws an
  882. * exception.
  883. */
  884. [infallible] readonly attribute boolean fullscreenAllowed;
  885. void setFullscreenAllowed(in boolean allowed);
  886. [notxpcom] uint32_t orientationLock();
  887. [notxpcom] void setOrientationLock(in uint32_t orientationLock);
  888. [noscript, infallible] attribute boolean affectPrivateSessionLifetime;
  889. /**
  890. * Indicates whether the UI may enable the character encoding menu. The UI
  891. * must disable the menu when this property is false.
  892. */
  893. [infallible] readonly attribute boolean mayEnableCharacterEncodingMenu;
  894. attribute nsIEditor editor;
  895. readonly attribute boolean editable; /* this docShell is editable */
  896. readonly attribute boolean hasEditingSession; /* this docShell has an editing session */
  897. /**
  898. * Make this docShell editable, setting a flag that causes
  899. * an editor to get created, either immediately, or after
  900. * a url has been loaded.
  901. * @param inWaitForUriLoad true to wait for a URI before
  902. * creating the editor.
  903. */
  904. void makeEditable(in boolean inWaitForUriLoad);
  905. /**
  906. * Get the SHEntry associated with a child docshell
  907. */
  908. nsISHEntry getChildSHEntry(in long aChildOffset);
  909. /**
  910. * Add a Child SHEntry for a frameset page, given the child's loadtype.
  911. * If aCloneChildren is true, then aCloneReference's children will be
  912. * cloned onto aHistoryEntry.
  913. */
  914. void addChildSHEntry(in nsISHEntry aCloneReference,
  915. in nsISHEntry aHistoryEntry,
  916. in long aChildOffset,
  917. in unsigned long aLoadType,
  918. in boolean aCloneChilden);
  919. /**
  920. * Whether this docshell should save entries in global history.
  921. */
  922. attribute boolean useGlobalHistory;
  923. /**
  924. * Removes nsISHEntry objects related to this docshell from session history.
  925. * Use this only with subdocuments, like iframes.
  926. */
  927. void removeFromSessionHistory();
  928. /**
  929. * Set when an iframe/frame is added dynamically.
  930. */
  931. attribute boolean createdDynamically;
  932. /**
  933. * Returns false for mLSHE, true for mOSHE
  934. */
  935. boolean getCurrentSHEntry(out nsISHEntry aEntry);
  936. /**
  937. * Cherry picked parts of nsIController.
  938. * They are here, because we want to call these functions
  939. * from JS.
  940. */
  941. boolean isCommandEnabled(in string command);
  942. void doCommand(in string command);
  943. void doCommandWithParams(in string command, in nsICommandParams aParams);
  944. /**
  945. * Invisible DocShell are dummy construct to simulate DOM windows
  946. * without any actual visual representation. They have to be marked
  947. * at construction time, to avoid any painting activity.
  948. */
  949. [noscript, notxpcom] bool IsInvisible();
  950. [noscript, notxpcom] void SetInvisible(in bool aIsInvisibleDochsell);
  951. /**
  952. * Get the script global for the document in this docshell.
  953. */
  954. [noscript,notxpcom,nostdcall] nsIScriptGlobalObject GetScriptGlobalObject();
  955. /**
  956. * If deviceSizeIsPageSize is set to true, device-width/height media queries
  957. * will be calculated from the page size, not the device size.
  958. *
  959. * Used by the Responsive Design Mode and B2G Simulator.
  960. *
  961. * Default is False.
  962. * Default value can be overriden with
  963. * docshell.device_size_is_page_size pref.
  964. */
  965. [infallible] attribute boolean deviceSizeIsPageSize;
  966. /**
  967. * Regarding setOpener / getOpener - We can't use XPIDL's "attribute"
  968. * for notxpcom, so we're relegated to using explicit gets / sets. This
  969. * should be fine, considering that these methods should only ever be
  970. * called from native code.
  971. */
  972. [noscript,notxpcom,nostdcall] void setOpener(in nsITabParent aOpener);
  973. [noscript,notxpcom,nostdcall] nsITabParent getOpener();
  974. /**
  975. * Notify DocShell when the browser is about to start executing JS, and after
  976. * that execution has stopped. This only occurs when the Timeline devtool
  977. * is collecting information.
  978. */
  979. [noscript,notxpcom,nostdcall] void notifyJSRunToCompletionStart(in string aReason,
  980. in wstring functionName,
  981. in wstring fileName,
  982. in unsigned long lineNumber,
  983. in jsval asyncStack,
  984. in string asyncCause);
  985. [noscript,notxpcom,nostdcall] void notifyJSRunToCompletionStop();
  986. /**
  987. * This attribute determines whether a document which is not about:blank has
  988. * already be loaded by this docShell.
  989. */
  990. [infallible] readonly attribute boolean hasLoadedNonBlankURI;
  991. /**
  992. * Allow usage of -moz-window-dragging:drag for content docshells.
  993. * True for top level chrome docshells. Throws if set to false with
  994. * top level chrome docshell.
  995. */
  996. attribute boolean windowDraggingAllowed;
  997. /**
  998. * Sets/gets the current scroll restoration mode.
  999. * @see https://html.spec.whatwg.org/#dom-history-scroll-restoration
  1000. */
  1001. attribute boolean currentScrollRestorationIsManual;
  1002. /**
  1003. * Setter and getter for the origin attributes living on this docshell.
  1004. */
  1005. [implicit_jscontext]
  1006. jsval getOriginAttributes();
  1007. [implicit_jscontext]
  1008. void setOriginAttributes(in jsval aAttrs);
  1009. /**
  1010. * The editing session for this docshell.
  1011. */
  1012. readonly attribute nsIEditingSession editingSession;
  1013. /**
  1014. * The tab child for this docshell.
  1015. */
  1016. [binaryname(ScriptableTabChild)] readonly attribute nsITabChild tabChild;
  1017. [noscript,notxpcom,nostdcall] TabChildRef GetTabChild();
  1018. [noscript,nostdcall,notxpcom] nsICommandManager GetCommandManager();
  1019. /**
  1020. * This allows chrome to override the default choice of whether touch events
  1021. * are available on a specific docshell. Possible values are listed below.
  1022. */
  1023. attribute unsigned long touchEventsOverride;
  1024. /**
  1025. * Override platform/pref default behaviour and force-disable touch events.
  1026. */
  1027. const unsigned long TOUCHEVENTS_OVERRIDE_DISABLED = 0;
  1028. /**
  1029. * Override platform/pref default behaviour and force-enable touch events.
  1030. */
  1031. const unsigned long TOUCHEVENTS_OVERRIDE_ENABLED = 1;
  1032. /**
  1033. * Don't override the platform/pref default behaviour for touch events.
  1034. */
  1035. const unsigned long TOUCHEVENTS_OVERRIDE_NONE = 2;
  1036. /**
  1037. * A DocShell is locked to the current process if it would be
  1038. * content-observable for a process switch to occur before performing a
  1039. * navigation load. It is important to ensure that a DocShell is not process
  1040. * locked before perfoming process changing loads.
  1041. */
  1042. [infallible] readonly attribute unsigned long processLockReason;
  1043. /**
  1044. * The DocShell is not locked to the current process, and a navigation may
  1045. * proceed in a new process.
  1046. */
  1047. const unsigned long PROCESS_LOCK_NONE = 0;
  1048. /**
  1049. * The DocShell is locked to the current process because it is not a
  1050. * toplevel browsing context.
  1051. */
  1052. const unsigned long PROCESS_LOCK_IFRAME = 1;
  1053. /**
  1054. * The DocShell is locked to the current process because there exist other
  1055. * related browsing contexts which may be holding a reference.
  1056. */
  1057. const unsigned long PROCESS_LOCK_RELATED_CONTEXTS = 2;
  1058. /**
  1059. * The DocShell is locked to the current process because the current
  1060. * process is not a content process.
  1061. *
  1062. * NOTE: Some loads may not consider this a hard process lock, and may wish to
  1063. * ignore this reason.
  1064. */
  1065. const unsigned long PROCESS_LOCK_NON_CONTENT = 3;
  1066. };