Bug 297286 (Changing Color breaks 'Set as desktop background') - Fire colorpicker and preferences events in the right context object. r=mconnor, a=asa

This commit is contained in:
mozilla.mano%sent.com 2005-07-05 05:17:59 +00:00
Родитель 53a5b9538a
Коммит e91ac43262
2 изменённых файлов: 7 добавлений и 4 удалений

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

@ -111,7 +111,7 @@
<setter><![CDATA[
if (!val)
return val;
uppercaseVal = val.toUpperCase();
var uppercaseVal = val.toUpperCase();
// Translate standard HTML color strings:
if (uppercaseVal[0] != "#") {
switch (val) {
@ -215,7 +215,8 @@
event.initEvent(aEventName, false, true);
var cancel = !aTarget.dispatchEvent(event);
if (aTarget.hasAttribute("on" + aEventName)) {
var rv = (new Function ("event", aTarget.getAttribute("on" + aEventName)))(event);
var fn = new Function ("event", aTarget.getAttribute("on" + aEventName));
var rv = fn.call(aTarget, event);
if (rv == false)
cancel = true;
}
@ -485,7 +486,8 @@
event.initEvent(aEventName, false, true);
var cancel = !aTarget.dispatchEvent(event);
if (aTarget.hasAttribute("on" + aEventName)) {
var rv = (new Function ("event", aTarget.getAttribute("on" + aEventName)))(event);
var fn = new Function ("event", aTarget.getAttribute("on" + aEventName));
var rv = fn.call(aTarget, event);
if (rv == false)
cancel = true;
}

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

@ -610,7 +610,8 @@
event.initEvent(aEventName, false, true);
var cancel = !aTarget.dispatchEvent(event);
if (aTarget.hasAttribute("on" + aEventName)) {
var rv = (new Function ("event", aTarget.getAttribute("on" + aEventName)))(event);
var fn = new Function ("event", aTarget.getAttribute("on" + aEventName));
var rv = fn.call(aTarget, event);
if (rv == false)
cancel = true;
}