Prevent access to compareTreePosition and friends from script.

bug 176135
r/sr=bzbarsky,jst a=roc+moz
This commit is contained in:
caillon%returnzero.com 2002-10-30 04:51:37 +00:00
Родитель cf7fcace02
Коммит 04a05caa28
2 изменённых файлов: 27 добавлений и 8 удалений

Просмотреть файл

@ -46,7 +46,14 @@ interface nsIDOM3Node : nsISupports
// Introduced in DOM Level 3:
readonly attribute DOMString baseURI;
// Introduced in DOM Level 3:
unsigned short compareTreePosition(in nsIDOMNode other);
// XXXcaa compareTreePosition existed in an old DOM3 Core WD:
// <http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20020409/>
// It has been renamed in the newest WD to compareDocumentPosition:
// <http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20021022/>
// Disable compareTreePosition from script only for now since we
// rely on it in C++. When we implement this as per the latest
// spec, re-enable it for scripts.
[noscript] unsigned short compareTreePosition(in nsIDOMNode other);
// Introduced in DOM Level 3:
boolean isSameNode(in nsIDOMNode other);
// Introduced in DOM Level 3:

Просмотреть файл

@ -110,12 +110,24 @@ interface nsIDOMNode : nsISupports
// Introduced in DOM Level 2:
boolean hasAttributes();
%{C++
// Introduced in DOM Level 3:
const unsigned short TREE_POSITION_PRECEDING = 0x01;
const unsigned short TREE_POSITION_FOLLOWING = 0x02;
const unsigned short TREE_POSITION_ANCESTOR = 0x04;
const unsigned short TREE_POSITION_DESCENDANT = 0x08;
const unsigned short TREE_POSITION_EQUIVALENT = 0x10;
const unsigned short TREE_POSITION_SAME_NODE = 0x20;
const unsigned short TREE_POSITION_DISCONNECTED = 0x00;
// XXXcaa the constants existed in an old DOM3 Core WD:
// <http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20020409/>
// They have been renamed in the newest WD:
// <http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20021022/>
// Disable these from script only for now since we rely on them
// in C++. When we implement them as per the latest spec,
// rename and re-enable them.
enum {
TREE_POSITION_PRECEDING = 0x01,
TREE_POSITION_FOLLOWING = 0x02,
TREE_POSITION_ANCESTOR = 0x04,
TREE_POSITION_DESCENDANT = 0x08,
TREE_POSITION_EQUIVALENT = 0x10,
TREE_POSITION_SAME_NODE = 0x20,
TREE_POSITION_DISCONNECTED = 0x00
};
%}
};