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.)
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | /* |
michael@0 | 7 | * Constant flags that describe how a document is sandboxed according to the |
michael@0 | 8 | * HTML5 spec. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | #ifndef nsSandboxFlags_h___ |
michael@0 | 12 | #define nsSandboxFlags_h___ |
michael@0 | 13 | |
michael@0 | 14 | /** |
michael@0 | 15 | * This flag prevents content from navigating browsing contexts other than |
michael@0 | 16 | * itself, browsing contexts nested inside it, the top-level browsing context |
michael@0 | 17 | * and browsing contexts that it has opened. |
michael@0 | 18 | * As it is always on for sandboxed browsing contexts, it is used implicitly |
michael@0 | 19 | * within the code by checking that the overall flags are non-zero. |
michael@0 | 20 | * It is only uesd directly when the sandbox flags are initially set up. |
michael@0 | 21 | */ |
michael@0 | 22 | const unsigned long SANDBOXED_NAVIGATION = 0x1; |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * This flag prevents content from navigating their top-level browsing |
michael@0 | 26 | * context. |
michael@0 | 27 | */ |
michael@0 | 28 | const unsigned long SANDBOXED_TOPLEVEL_NAVIGATION = 0x2; |
michael@0 | 29 | |
michael@0 | 30 | /** |
michael@0 | 31 | * This flag prevents content from instantiating plugins, whether using the |
michael@0 | 32 | * embed element, the object element, the applet element, or through |
michael@0 | 33 | * navigation of a nested browsing context, unless those plugins can be |
michael@0 | 34 | * secured. |
michael@0 | 35 | */ |
michael@0 | 36 | const unsigned long SANDBOXED_PLUGINS = 0x4; |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * This flag forces content into a unique origin, thus preventing it from |
michael@0 | 40 | * accessing other content from the same origin. |
michael@0 | 41 | * This flag also prevents script from reading from or writing to the |
michael@0 | 42 | * document.cookie IDL attribute, and blocks access to localStorage. |
michael@0 | 43 | */ |
michael@0 | 44 | const unsigned long SANDBOXED_ORIGIN = 0x8; |
michael@0 | 45 | |
michael@0 | 46 | /** |
michael@0 | 47 | * This flag blocks form submission. |
michael@0 | 48 | */ |
michael@0 | 49 | const unsigned long SANDBOXED_FORMS = 0x10; |
michael@0 | 50 | |
michael@0 | 51 | /** |
michael@0 | 52 | * This flag blocks script execution. |
michael@0 | 53 | */ |
michael@0 | 54 | const unsigned long SANDBOXED_SCRIPTS = 0x20; |
michael@0 | 55 | |
michael@0 | 56 | /** |
michael@0 | 57 | * This flag blocks features that trigger automatically, such as |
michael@0 | 58 | * automatically playing a video or automatically focusing a form control. |
michael@0 | 59 | */ |
michael@0 | 60 | const unsigned long SANDBOXED_AUTOMATIC_FEATURES = 0x40; |
michael@0 | 61 | |
michael@0 | 62 | /** |
michael@0 | 63 | * This flag blocks the document from acquiring pointerlock. |
michael@0 | 64 | */ |
michael@0 | 65 | const unsigned long SANDBOXED_POINTER_LOCK = 0x80; |
michael@0 | 66 | |
michael@0 | 67 | /** |
michael@0 | 68 | * This flag blocks the document from changing document.domain. |
michael@0 | 69 | */ |
michael@0 | 70 | const unsigned long SANDBOXED_DOMAIN = 0x100; |
michael@0 | 71 | |
michael@0 | 72 | /** |
michael@0 | 73 | * This flag prevents content from creating new auxiliary browsing contexts, |
michael@0 | 74 | * e.g. using the target attribute, the window.open() method, or the |
michael@0 | 75 | * showModalDialog() method. |
michael@0 | 76 | */ |
michael@0 | 77 | const unsigned long SANDBOXED_AUXILIARY_NAVIGATION = 0x200; |
michael@0 | 78 | #endif |