Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 * Constant flags that describe how a document is sandboxed according to the
8 * HTML5 spec.
9 */
11 #ifndef nsSandboxFlags_h___
12 #define nsSandboxFlags_h___
14 /**
15 * This flag prevents content from navigating browsing contexts other than
16 * itself, browsing contexts nested inside it, the top-level browsing context
17 * and browsing contexts that it has opened.
18 * As it is always on for sandboxed browsing contexts, it is used implicitly
19 * within the code by checking that the overall flags are non-zero.
20 * It is only uesd directly when the sandbox flags are initially set up.
21 */
22 const unsigned long SANDBOXED_NAVIGATION = 0x1;
24 /**
25 * This flag prevents content from navigating their top-level browsing
26 * context.
27 */
28 const unsigned long SANDBOXED_TOPLEVEL_NAVIGATION = 0x2;
30 /**
31 * This flag prevents content from instantiating plugins, whether using the
32 * embed element, the object element, the applet element, or through
33 * navigation of a nested browsing context, unless those plugins can be
34 * secured.
35 */
36 const unsigned long SANDBOXED_PLUGINS = 0x4;
38 /**
39 * This flag forces content into a unique origin, thus preventing it from
40 * accessing other content from the same origin.
41 * This flag also prevents script from reading from or writing to the
42 * document.cookie IDL attribute, and blocks access to localStorage.
43 */
44 const unsigned long SANDBOXED_ORIGIN = 0x8;
46 /**
47 * This flag blocks form submission.
48 */
49 const unsigned long SANDBOXED_FORMS = 0x10;
51 /**
52 * This flag blocks script execution.
53 */
54 const unsigned long SANDBOXED_SCRIPTS = 0x20;
56 /**
57 * This flag blocks features that trigger automatically, such as
58 * automatically playing a video or automatically focusing a form control.
59 */
60 const unsigned long SANDBOXED_AUTOMATIC_FEATURES = 0x40;
62 /**
63 * This flag blocks the document from acquiring pointerlock.
64 */
65 const unsigned long SANDBOXED_POINTER_LOCK = 0x80;
67 /**
68 * This flag blocks the document from changing document.domain.
69 */
70 const unsigned long SANDBOXED_DOMAIN = 0x100;
72 /**
73 * This flag prevents content from creating new auxiliary browsing contexts,
74 * e.g. using the target attribute, the window.open() method, or the
75 * showModalDialog() method.
76 */
77 const unsigned long SANDBOXED_AUXILIARY_NAVIGATION = 0x200;
78 #endif