зеркало из https://github.com/mozilla/pjs.git
Prevent access to compareTreePosition and friends from script.
bug 176135 r/sr=bzbarsky,jst a=roc+moz
This commit is contained in:
Родитель
cf7fcace02
Коммит
04a05caa28
|
@ -46,7 +46,14 @@ interface nsIDOM3Node : nsISupports
|
||||||
// Introduced in DOM Level 3:
|
// Introduced in DOM Level 3:
|
||||||
readonly attribute DOMString baseURI;
|
readonly attribute DOMString baseURI;
|
||||||
// Introduced in DOM Level 3:
|
// 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:
|
// Introduced in DOM Level 3:
|
||||||
boolean isSameNode(in nsIDOMNode other);
|
boolean isSameNode(in nsIDOMNode other);
|
||||||
// Introduced in DOM Level 3:
|
// Introduced in DOM Level 3:
|
||||||
|
|
|
@ -110,12 +110,24 @@ interface nsIDOMNode : nsISupports
|
||||||
// Introduced in DOM Level 2:
|
// Introduced in DOM Level 2:
|
||||||
boolean hasAttributes();
|
boolean hasAttributes();
|
||||||
|
|
||||||
|
%{C++
|
||||||
// Introduced in DOM Level 3:
|
// Introduced in DOM Level 3:
|
||||||
const unsigned short TREE_POSITION_PRECEDING = 0x01;
|
// XXXcaa the constants existed in an old DOM3 Core WD:
|
||||||
const unsigned short TREE_POSITION_FOLLOWING = 0x02;
|
// <http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20020409/>
|
||||||
const unsigned short TREE_POSITION_ANCESTOR = 0x04;
|
// They have been renamed in the newest WD:
|
||||||
const unsigned short TREE_POSITION_DESCENDANT = 0x08;
|
// <http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20021022/>
|
||||||
const unsigned short TREE_POSITION_EQUIVALENT = 0x10;
|
// Disable these from script only for now since we rely on them
|
||||||
const unsigned short TREE_POSITION_SAME_NODE = 0x20;
|
// in C++. When we implement them as per the latest spec,
|
||||||
const unsigned short TREE_POSITION_DISCONNECTED = 0x00;
|
// 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
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче