Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////")
7 cpp_quote("//")
8 cpp_quote("// ISimpleDOMNode")
9 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
10 cpp_quote("// An interface that extends MSAA's IAccessible to provide readonly DOM node information via cross-process COM.")
11 cpp_quote("//")
12 cpp_quote("// get_nodeInfo(")
13 cpp_quote("// /* [out] */ BSTR *nodeName, // For elements, this is the tag name")
14 cpp_quote("// /* [out] */ short *nameSpaceID,")
15 cpp_quote("// /* [out] */ BSTR *nodeValue, ")
16 cpp_quote("// /* [out] */ unsigned int *numChildren); ")
17 cpp_quote("// /* [out] */ unsigned int *uniqueID; // In Win32 accessible events we generate, the target's childID matches to this")
18 cpp_quote("// /* [out] */ unsigned short *nodeType,")
19 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
20 cpp_quote("// Get the basic information about a node.")
21 cpp_quote("// The namespace ID can be mapped to an URI using nsISimpleDOMDocument::get_nameSpaceURIForID()")
22 cpp_quote("//")
23 cpp_quote("// get_attributes(")
24 cpp_quote("// /* [in] */ unsigned short maxAttribs,")
25 cpp_quote("// /* [out] */ unsigned short *numAttribs,")
26 cpp_quote("// /* [out] */ BSTR *attribNames,")
27 cpp_quote("// /* [out] */ short *nameSpaceID,")
28 cpp_quote("// /* [out] */ BSTR *attribValues);")
29 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
30 cpp_quote("// Returns 3 arrays - the attribute names and values, and a namespace ID for each")
31 cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace")
32 cpp_quote("//")
33 cpp_quote("// get_attributesForNames(")
34 cpp_quote("// /* [in] */ unsigned short numAttribs,")
35 cpp_quote("// /* [in] */ BSTR *attribNames,")
36 cpp_quote("// /* [in] */ short *nameSpaceID,")
37 cpp_quote("// /* [out] */ BSTR *attribValues);")
38 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
39 cpp_quote("// Takes 2 arrays - the attribute names and namespace IDs, and returns an array of corresponding values")
40 cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace")
41 cpp_quote("//")
42 cpp_quote("// computedStyle( ")
43 cpp_quote("// /* [in] */ unsigned short maxStyleProperties,")
44 cpp_quote("// /* [out] */ unsigned short *numStyleProperties, ")
45 cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
46 cpp_quote("// /* [out] */ BSTR *styleProperties, ")
47 cpp_quote("// /* [out] */ BSTR *styleValues);")
48 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
49 cpp_quote("// Returns 2 arrays -- the style properties and their values")
50 cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)")
51 cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()")
52 cpp_quote("//")
53 cpp_quote("// computedStyleForProperties( ")
54 cpp_quote("// /* [in] */ unsigned short numStyleProperties, ")
55 cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
56 cpp_quote("// /* [in] */ BSTR *styleProperties, ")
57 cpp_quote("// /* [out] */ BSTR *styleValues);")
58 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
59 cpp_quote("// Scroll the current view so that this dom node is visible.")
60 cpp_quote("// placeTopLeft=TRUE: scroll until the top left corner of the dom node is at the top left corner of the view.")
61 cpp_quote("// placeTopLeft=FALSE: scroll minimally to make the dom node visible. Don't scroll at all if already visible.")
62 cpp_quote("//")
63 cpp_quote("// scrollTo( ")
64 cpp_quote("// /* [in] */ boolean placeTopLeft); ")
65 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
66 cpp_quote("// Returns style property values for those properties in the styleProperties [in] array")
67 cpp_quote("// Returns 2 arrays -- the style properties and their values")
68 cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)")
69 cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()")
70 cpp_quote("//")
71 cpp_quote("// get_parentNode (/* [out] */ ISimpleDOMNode **newNodePtr);")
72 cpp_quote("// get_firstChild (/* [out] */ ISimpleDOMNode **newNodePtr);")
73 cpp_quote("// get_lastChild (/* [out] */ ISimpleDOMNode **newNodePtr);")
74 cpp_quote("// get_previousSibling(/* [out] */ ISimpleDOMNode **newNodePtr);")
75 cpp_quote("// get_nextSibling (/* [out] */ ISimpleDOMNode **newNodePtr);")
76 cpp_quote("// get_childAt (/* [in] */ unsigned childIndex, /* [out] */ ISimpleDOMNode **newNodePtr);")
77 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
78 cpp_quote("// DOM navigation - get a different node.")
79 cpp_quote("//")
80 cpp_quote("// get_innerHTML(/* [out] */ BSTR *htmlText);")
81 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
82 cpp_quote("// Returns HTML of this DOM node's subtree. Does not include the start and end tag for this node/element.")
83 cpp_quote("//")
84 cpp_quote("//")
85 cpp_quote("// get_localInterface(/* [out] */ void **localInterface);")
86 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
87 cpp_quote("// Only available in Gecko's process")
88 cpp_quote("//")
89 cpp_quote("//")
90 cpp_quote("// get_language(/* [out] */ BSTR *htmlText);")
91 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
92 cpp_quote("// Returns the computed language for this node, or empty string if unknown.")
93 cpp_quote("//")
94 cpp_quote("//")
95 cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////")
96 cpp_quote("")
97 cpp_quote("")
99 import "objidl.idl";
100 import "oaidl.idl";
102 import "ISimpleDOMText.idl";
103 import "ISimpleDOMDocument.idl";
105 [object, uuid(1814ceeb-49e2-407f-af99-fa755a7d2607)]
106 interface ISimpleDOMNode : IUnknown
107 {
108 const unsigned short NODETYPE_ELEMENT = 1;
109 const unsigned short NODETYPE_ATTRIBUTE = 2;
110 const unsigned short NODETYPE_TEXT = 3;
111 const unsigned short NODETYPE_CDATA_SECTION = 4;
112 const unsigned short NODETYPE_ENTITY_REFERENCE = 5;
113 const unsigned short NODETYPE_ENTITY = 6;
114 const unsigned short NODETYPE_PROCESSING_INSTRUCTION = 7;
115 const unsigned short NODETYPE_COMMENT = 8;
116 const unsigned short NODETYPE_DOCUMENT = 9;
117 const unsigned short NODETYPE_DOCUMENT_TYPE = 10;
118 const unsigned short NODETYPE_DOCUMENT_FRAGMENT = 11;
119 const unsigned short NODETYPE_NOTATION = 12;
121 [propget] HRESULT nodeInfo(
122 [out] BSTR *nodeName, // for performance returns NULL for text nodes (true nodeName would be "#text")
123 [out] short *nameSpaceID,
124 [out] BSTR *nodeValue,
125 [out] unsigned int *numChildren,
126 [out] unsigned int *uniqueID, // In Win32 accessible events we generate, the target's childID matches to this
127 [out, retval] unsigned short *nodeType
128 );
130 [propget] HRESULT attributes(
131 [in] unsigned short maxAttribs,
132 [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames,
133 [out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID,
134 [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribValues,
135 [out, retval] unsigned short *numAttribs
136 );
138 [propget] HRESULT attributesForNames(
139 [in] unsigned short numAttribs,
140 [in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames,
141 [in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID,
142 [out, retval, size_is(numAttribs), length_is(numAttribs)] BSTR *attribValues
143 );
145 [propget] HRESULT computedStyle(
146 [in] unsigned short maxStyleProperties,
147 [in] boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
148 [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties,
149 [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues,
150 [out, retval] unsigned short *numStyleProperties
151 );
153 [propget] HRESULT computedStyleForProperties(
154 [in] unsigned short numStyleProperties,
155 [in] boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
156 [in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties,
157 [out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues
158 );
160 HRESULT scrollTo([in] boolean placeTopLeft);
162 [propget] HRESULT parentNode([out, retval] ISimpleDOMNode **node);
163 [propget] HRESULT firstChild([out, retval] ISimpleDOMNode **node);
164 [propget] HRESULT lastChild([out, retval] ISimpleDOMNode **node);
165 [propget] HRESULT previousSibling([out, retval] ISimpleDOMNode **node);
166 [propget] HRESULT nextSibling([out, retval] ISimpleDOMNode **node);
167 [propget] HRESULT childAt([in] unsigned childIndex,
168 [out, retval] ISimpleDOMNode **node);
170 [propget] HRESULT innerHTML([out, retval] BSTR *innerHTML);
172 [propget, local] HRESULT localInterface([out][retval] void **localInterface);
174 [propget] HRESULT language([out, retval] BSTR *language);
175 }
178 [
179 uuid(a6245497-9c0b-4449-85a5-bd6ad07df8ea),
180 helpstring("ISimpleDOM Type Library")
181 ]
182 library ISimpleDOM
183 {
184 interface ISimpleDOMNode;
185 interface ISimpleDOMText;
186 interface ISimpleDOMDocument;
187 };