зеркало из https://github.com/mozilla/pjs.git
XBL changes.
This commit is contained in:
Родитель
f9f60f84de
Коммит
b05a016994
|
@ -115,8 +115,10 @@ nsBindingManager::SetBinding(nsIContent* aContent, nsIXBLBinding* aBinding )
|
||||||
mBindingTable = new nsSupportsHashtable;
|
mBindingTable = new nsSupportsHashtable;
|
||||||
|
|
||||||
nsISupportsKey key(aContent);
|
nsISupportsKey key(aContent);
|
||||||
if (aBinding)
|
if (aBinding) {
|
||||||
mBindingTable->Put(&key, aBinding);
|
nsIXBLBinding* oldBinding = NS_STATIC_CAST(nsIXBLBinding*, mBindingTable->Put(&key, aBinding));
|
||||||
|
NS_IF_RELEASE(oldBinding);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
mBindingTable->Remove(&key);
|
mBindingTable->Remove(&key);
|
||||||
|
|
||||||
|
|
|
@ -854,7 +854,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
// destruction of any initial value that might be set.
|
// destruction of any initial value that might be set.
|
||||||
// This means we only have to worry about defining the getter
|
// This means we only have to worry about defining the getter
|
||||||
// or setter.
|
// or setter.
|
||||||
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
||||||
name.Length(), JSVAL_VOID,
|
name.Length(), JSVAL_VOID,
|
||||||
(JSPropertyOp) getFunc,
|
(JSPropertyOp) getFunc,
|
||||||
(JSPropertyOp) setFunc,
|
(JSPropertyOp) setFunc,
|
||||||
|
@ -887,7 +887,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
|
|
||||||
if (!undefined) {
|
if (!undefined) {
|
||||||
// Define that value as a property
|
// Define that value as a property
|
||||||
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
||||||
name.Length(), result,
|
name.Length(), result,
|
||||||
nsnull, nsnull,
|
nsnull, nsnull,
|
||||||
attrs);
|
attrs);
|
||||||
|
|
|
@ -115,8 +115,10 @@ nsBindingManager::SetBinding(nsIContent* aContent, nsIXBLBinding* aBinding )
|
||||||
mBindingTable = new nsSupportsHashtable;
|
mBindingTable = new nsSupportsHashtable;
|
||||||
|
|
||||||
nsISupportsKey key(aContent);
|
nsISupportsKey key(aContent);
|
||||||
if (aBinding)
|
if (aBinding) {
|
||||||
mBindingTable->Put(&key, aBinding);
|
nsIXBLBinding* oldBinding = NS_STATIC_CAST(nsIXBLBinding*, mBindingTable->Put(&key, aBinding));
|
||||||
|
NS_IF_RELEASE(oldBinding);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
mBindingTable->Remove(&key);
|
mBindingTable->Remove(&key);
|
||||||
|
|
||||||
|
|
|
@ -854,7 +854,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
// destruction of any initial value that might be set.
|
// destruction of any initial value that might be set.
|
||||||
// This means we only have to worry about defining the getter
|
// This means we only have to worry about defining the getter
|
||||||
// or setter.
|
// or setter.
|
||||||
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
||||||
name.Length(), JSVAL_VOID,
|
name.Length(), JSVAL_VOID,
|
||||||
(JSPropertyOp) getFunc,
|
(JSPropertyOp) getFunc,
|
||||||
(JSPropertyOp) setFunc,
|
(JSPropertyOp) setFunc,
|
||||||
|
@ -887,7 +887,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
|
||||||
|
|
||||||
if (!undefined) {
|
if (!undefined) {
|
||||||
// Define that value as a property
|
// Define that value as a property
|
||||||
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
|
||||||
name.Length(), result,
|
name.Length(), result,
|
||||||
nsnull, nsnull,
|
nsnull, nsnull,
|
||||||
attrs);
|
attrs);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче