<html><style>
.broken { color: red; }
.fixed { color: blue; }
</style>
<body><p><b>Corrections</b>
<p>This page contains a list of corrections to be made in the next printing of
the book. If you have suggestions for changes or find errors in the text,
feel free open a <a href="bugs.html">bug</a> with a report of the problem, post a message in the User Notes
section on the chapter pages, or send a message to the <a
href="mailto:reviewers@mozdev.org">reviewers@mozdev.org</a> mailing list.
<p><b>Note:</b> All errors in the text and examples are shown in <b class="broken">red</b> and all corrections are shown in <b
class="fixed">blue</b>.
<a name="preface"></a>
<p><b>Preface</b>
<ul>
<li>On page ix: '<b class="broken">other browsers such as Galeon and Chimera</b>' has been changed to '<b class="fixed">other browsers
such as Galeon and Camino</b>'<br><br>
<li>On page xiv: '<b class="broken">http://www.oreilly.com/mozilla/</b>' has been changed
to '<b class="fixed">http://www.oreilly.com/catalog/mozilla/</b>'<br><br>
<li>On page xvii: '<b class="broken">David McNamara, and Mark Hammond</b>' has been changed to '<b class="fixed">David
McNamara, Mark Hammond, Gary Frederick, and Andreas Halter</b>'<br><br>
<li>On page xvii: '<b class="broken">David Hyatt and Mike Pinkerton for the Chimera browser</b>' has been changed to '<b
class="fixed">David Hyatt and Mike Pinkerton for the Camino browser</b>'<br><br>
<li>On page xvii: '<b class="broken">including Kim Steckler, Rachel Oeschger, and Priscilla, Dylan, and Devon Collins</b>' has been
changed to '<b class="fixed">including Kim Steckler, Rachel Oeschger, Marjana Molan, Lia Molan King, and Priscilla, Dylan, and Devon
Collins</b>'<br><br>
</ul>
<a name="ch1"></a>
<p><b>Chapter 1</b>
<ul>
<li>On page 2: In sidebar '<b class="broken">like Chimera (an ultra-fast browser that works only on Mac OS X)</b>' has been changed to
'<b class="fixed">like Camino (an ultra-fast browser that works only on Mac OS X)</b>'<br><br>
<li>On page 7: In sidebar '<b class="broken">Another project, call m/b (short for mozilla/browser), addresses shortcomings</b>' has
been changed to '<b class="fixed">The Phoenix project (http://www.mozilla.org/projects/phoenix/) also addresses
shortcomings</b>'<br><br>
<li>On page 7: In sidebar '<b class="broken">Some examples include Chimera (http://chimera.mozdev.org)</b>' has been changed to '<b
class="fixed">Some examples include Camino (http://www.mozilla.org/projects/camino/)</b>'<br><br>
<li>On page 7: '<b class="broken">applications web built using XPFE</b>' has been
changed to '<b class="fixed">applications built using XPFE</b>'<br><br>
</ul>
<a name="ch2"></a>
<p><b>Chapter 2</b>
<ul>
<li>On page 10: Added a new sentence to the end of the 2nd paragraph of the xFly examples sidebar: '<b class="fixed">An installable version
of the complete xFly application can be found at http://xfly.mozdev.org.</b>'<br><br>
<li>On page 12: '<b class="broken"><window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
/></b>' has been changed to '<b class="fixed"><window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"></b>'<br><br>
<li>On page 14: In first code sample from Windows features section, '<b
class="broken">xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"></b>' has been changed to '<b
class="fixed">xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"</b>'<br><br>
<li>On page 17: '<b class="broken">selecting File > Open File > from</b>' has been
changed to '<b class="fixed">selecting File > Open File from</b>'<br><br>
<li>On page 20: '<b class="broken">CenterWindoOnScreen( ) function</b>' has been changed
to '<b class="fixed">CenterWindowOnScreen( ) function</b>'<br><br>
<li>On page 25: '<b class="broken">Under that directory, create the three new directories, <i>content</i>, <i>locale</i>, and <i>skin</i>, as
shown in Figure 2-5.</b>' has been changed to '<b class="fixed">Under that directory, create the three new directories, <i>content</i>,
<i>locale</i>, and <i>skin</i>, as shown in Figure 2-5. The <i>locale</i> directory will have the default 'en-US' language pack
structure.</b>'<br><br>
<li>On page 31: In Example 2-14 '<b class="broken">locale/</b>' has been changed to '<b class="fixed">locale/en-US/</b>'<br><br>
<li>On page 32: In Example 2-15 '<b class="broken">locale,install,url,resource:/chrome/xfly/locale/</b>' has been changed to '<b
class="fixed">locale,install,url,resource:/chrome/xfly/locale/en-US/</b>'<br><br>
</ul>
<a name="ch3"></a>
<p><b>Chapter 3</b>
<ul>
<li>On page 34: '<b class="broken">We've packed a lot information in this chapter and it be a useful reference</b>' has been changed
to '<b class="fixed">We've packed a lot of information in this chapter and it will be a useful reference</b>'<br><br>
<li>On page 35: '<b class="broken">secondLevelNodes[I] = docEl.childNodes[i];</b>' has been changed to '<b
class="fixed">secondLevelNodes[I] = docEl.childNodes[I];</b>'<br><br>
<li>On page 38: In Example 3-3 the namespace declarations have been changed to (note the addition of quotes and the removal of italics)
<xmp class="fixed">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#">
</xmp>
<li>On page 38: In Example 3-3 '<b class="broken"><image src="page1.png"></b>' has been changed to '<b class="fixed"><image
src="page1.png"/></b>'<br><br>
<li>On page 40: '<b class="broken"><toolbarbutton id="printBtn" label="Open"
oncommand="doPrint( );" /></b>' has been changed to '<b class="fixed"><toolbarbutton
id="printBtn" label="Print" oncommand="doPrint( );" ></b>'<br><br>
<li>On page 51: '<b class="broken"><decription>The mozdev.org site [...] your own development project</decription></b>' has been
changed to '<b class="fixed"><description>The mozdev.org site [...] your own development project</description></b>'<br><br>
<li>On page 54: '<b class="broken">Clicking on the box sets the <tt>clicked</tt> attribute</b>' has been
changed to '<b class="fixed">Clicking on the box sets the <tt>checked</tt> attribute</b>'<br><br>
<li>On pages 58 and 59: Example 3-15 has been changed to (note the addition of spaces to seperate values)
<xmp class="fixed">
<?xml version="1.0"?>
<window id="hello-goodbye"
title="Hello Goodbye"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="min-width:100px;min-height:100px;background-color:white;">
<broadcasterset id="broadcasterset">
<broadcaster id="cmd_hello" oncommand="alert('Hello There!');"/>
</broadcasterset>
<keyset id="keyset">
<key id="key_h" key="H" observes="cmd_hello" modifiers="accel,shift" />
<key id="key_g" key="G" command="cmd_goodbye" modifiers="accel,shift" />
</keyset>
<commandset id="commandset">
<command id="cmd_goodbye" oncommand="alert('Goodbye!');" />
</commandset>
<spacer flex="1"/>
<label value="hello/goodbye"/>
<textbox value="type ctl+shft+h"/>
<textbox value="type ctl+shft+g"/>
<spacer flex="1"/>
</window>
</xmp>
<li>On page 63: '<b class="broken">But there are also CSS versions of these properties that
use the prefix <tt>box-pack</tt> becomes <tt>box-pack</tt> when it's defined in CSS, for example.</b>' has been
changed to '<b class="fixed">But there are also CSS versions of these properties that
use the prefix <tt>box-</tt>. <tt>pack</tt> becomes <tt>box-pack</tt> when it's defined in CSS, for example.</b>'<br><br>
</ul>
<a name="ch4"></a>
<p><b>Chapter 4</b>
<ul>
<li>On page 88: '<b class="broken">these are selectors are identical</b>' has been changed to '<b class="fixed">these selectors are
identical</b>'<br><br>
<li>On page 109: '<b class="broken">The <i>chome</i> URL that the -moz-binding property points to</b>' has been changed to '<b
class="fixed">The <i>chrome</i> URL that the -moz-binding property points to</b>'<br><br>
</ul>
<a name="ch5"></a>
<p><b>Chapter 5</b>
<ul>
<li>On page 113: Javascript 1.5 reference link in footnote has been changed from
'<b class="broken">http://developer.netscape.com/docs/manuals/js/core/jsref15/contents.html</b>' to
'<b class="fixed">http://developer.netscape.com/docs/manuals/index.html?content=javascript.html</b>'<br><br>
</li>
<li>On page 120: '<b class="broken"></script.</b>' has been changed to '<b class="fixed"></script></b>'<br><br>
</li>
<li>On page 120: '<b class="broken">dump(l+'\n');</b>' has been changed to '<b class="fixed">dump(len+'\n');</b>'<br><br>
</li>
<li>On page 135: Example 5-11 has been changed to
<xmp class="fixed">
<head>
<title>Sound Service Play Example</title>
<script>
function play() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var sample = Components.classes["@mozilla.org/sound;1"].createInstance();
sample = sample.QueryInterface(Components.interfaces.nsISound);
const SND_NETWORK_STD_CID = "@mozilla.org/network/standard-url;1";
const SND_I_URL = "nsIURL";
const SND_URL = new C.Constructor(SND_NETWORK_STD_CID, SND_I_URL);
var url = new SND_URL();
url.spec = 'http://jslib.mozdev.org/test.wav';
sample.play(url);
}
</script>
</head>
<form name="form">
<input type="button" value="Play Sound" onclick="play();">
</form>
</xmp>
<li>On page 137: '<b class="broken">var connection = Components.classes ["@mozilla.org/network/ldap-connection;1";</b>'
has been changed to
'<b class="fixed">var connection = Components.classes ["@mozilla.org/network/ldap-connection;1"];</b>'<br><br>
</li>
<li>On page 140: '<b class="broken">js> load(`chrome/jslib/jslib.js');</b>' has been changed to '<b class="fixed">js>
load('chrome/jslib/jslib.js');</b>'<br><br>
</li>
</ul>
<a name="ch06"></a>
<p><b>Chapter 6</b>
<ul>
<li>On page 145: Example 6-1 has been changed to <br/>
<xmp class="fixed">
var myFile = "xFly.jar";
initInstall( // initialize the installation
"Install xFly", // display name of installation
"xFly", // package name
"0.0.1", // version of install
1); // flags - an optional argument,
// reserved for future use
f = getFolder("Chrome"); // specify a target directory
setPackageFolder(f);
addFile(myFile); // add software to the installation
registerChrome(
PACKAGE | DELAYED_CHROME, // chrome switch (i.e., type)
getFolder("Chrome","xFly.jar"), // destination of package
"content/xFly/"); // location of manifest in package
if (0 == getLastError( )) // if there have been no errors:
performInstall( ); // install "xfly.jar"
else // otherwise
cancelInstall( ); // cancel the installation.
</xmp>
</ul>
<a name="ch07"></a>
<p><b>Chapter 7</b>
<ul>
<li>On page 181: There are 3 errors in Figure 7-2 ...<br><br>
1) In the XUL box, '<b class="broken">klabel="Input Field"</b>' should be '<b class="fixed">label="Input Field"</b>'<br><br>
2) In the XBL box, '<b class="broken"><binding id+"inputfield"></b>' should be '<b class="fixed"><binding id="inputfield"></b>'<br><br>
3) In the XBL box, '<b class="broken"><xul:label xbl:inherits="value+label"?></b>' should be '<b class="fixed"><xul:label xbl:inherits="value=label"/></b>'<br><br>
Here is a correct image <b>(Click for bigger version)</b>:<br><br>
<a href="http://books.mozdev.org/screenshots/moz_0702.gif"><img src="http://books.mozdev.org/screenshots/moz_0702_small.gif" width="200" height="132" border=0 alt="Figure 7-2"></a>
</li>
</ul>
</p>
<a name="ch08"></a>
<p><b>Chapter 8</b>
<ul>
<li>On page 211: In 2nd sentence of paragraph '<b class="broken">QueryInterace</b>' has been
changed to '<b class="fixed">QueryInterface</b>'<br><br></li>
<li>On page 222: In Example 8-4 has been changed to:
<xmp class="fixed">
function SimpleComponent(){}
SimpleComponent.prototype = {
get yourName() { return this.mName; },
set yourName(aName) { return this.mName = aName; },
write: function () { dump("Hello " + this.mName + "\n"); },
change: function (aValue) { this.mName = aValue; },
mName: "a default value",
QueryInterface: function (iid) {
if (!iid.equals(Components.interfaces.nsISimple)
&& !iid.equals(Components.interfaces.nsISupports))
{
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
}
}
var Module = {
firstTime: true,
registerSelf: function (compMgr, fileSpec, location, type) {
if (this.firstTime) {
dump("*** Deferring registration of simple JS components\n");
this.firstTime = false;
throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
}
debug("*** Registering sample JS components\n");
compMgr =
compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
compMgr.registerFactoryLocation(this.myCID,
"Simple JS Component",
this.myProgID,
fileSpec,
location,
type);
},
getClassObject : function (compMgr, cid, iid) {
if (!cid.equals(this.myCID))
throw Components.results.NS_ERROR_NO_INTERFACE
if (!iid.equals(Components.interfaces.nsIFactory))
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
return this.myFactory;
},
myCID: Components.ID("{98aa9afd-8b08-415b-91ed-01916a130d16}"),
myProgID: "@mozilla.org/js_simple_component;1",
myFactory: {
createInstance: function (outer, iid) {
dump("CI: " + iid + "\n");
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
return (new SimpleComponent()).QueryInterface(iid);
}
},
canUnload: function(compMgr) {
dump("****** Unloading: Simple JS component! ****** \n");
return true;
}
}; // END Module
function NSGetModule(compMgr, fileSpec) { return Module; }
</xmp>
</li>
<li>On page 239: Example 8-15 has been changed to <br/></li>
<xmp class="fixed">
DEPTH = ../../..
topsrcdir = ../../..
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
MODULE = xpcom
XPIDL_MODULE = simple
LIBRARY_NAME = simple
IS_COMPONENT = 1
MODULE_NAME = nsSimpleModule
REQUIRES = string \
xpcom \
$(NULL)
CPPSRCS = \
nsSimple.cpp \
nsSimpleModule.cpp \
$(NULL)
XPIDLSRCS = nsISimple.idl
include $(topsrcdir)/config/config.mk
LIBS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
install:: $(TARGETS)
</xmp>
</ul>
<a name="ch9"></a>
<p><b>Chapter 9</b>
<ul>
<li>On page 257: In Example 9-7
<xmp class="broken">
<triple subject="?listitem"
predicate=" http://xfly.mozdev.org/fly-rdf#location"
object="?location"/>
</xmp>
has been changed to
<xmp class="fixed">
<triple subject="?listitem"
predicate="fly-location#location"
object="?location"/>
</xmp>
</ul>
<a name="ch10"></a>
<p><b>Chapter 10</b>
<ul>
<li>On page 280: In Table 10-3 '<b class="broken">Mostly used for retrieving, datasources, resources, and literals.</b>' has been
changed to '<b class="fixed">Mostly used for retrieving datasources, resources, and literals.</b>'<br><br>
<li>On page 297: '<b class="broken">http://www.jslib.mozdev.org</b>' has been changed to '<b
class="fixed">http://jslib.mozdev.org</b>'<br><br>
</ul>
<a name="ch11"></a>
<p><b>Chapter 11</b>
<ul>
<li>On page 314: In Example 11-5 and Example 11-6 '<b class="broken">var linetext =
document.createTextNode(messageParagraphs[i]);</b>' has been changed to '<b class="fixed">var linetext =
document.createTextNode(lines[i]);</b>'<br><br>
</ul>
<a name="ch12"></a>
<p><b>Chapter 12</b>
<ul>
<li>On page 336: In Example 12-6
<xmp class="broken">
print ` <checkbox label="%s" />' % form['op1'].value
print ` <checkbox label="%s" />' % form['op2'].value
print ` <checkbox label="%s" />' % form['op3'].value
</xmp>
has been changed to (note the difference in indentation and in using a single quote versus a backtick)
<xmp class="fixed">
print ' <checkbox label="%s" />' % form['op1'].value
print ' <checkbox label="%s" />' % form['op2'].value
print ' <checkbox label="%s" />' % form['op3'].value
</xmp>
<!--
<li>On page 339: A new 'Certificate Authorities and Digital
Signatures' section is being written with drafts available on <a
href="http://certs.mozdev.org">http://certs.mozdev.org</a><br><br>
</li>
-->
</ul>
<a name="appa"></a>
<p><b>Appendix A</b>
<ul>
<li>On page 365: '<b class="broken">http://www.mozilla.org/source.tml</b>' has been changed to '<b
class="fixed">http://www.mozilla.org/source.html</b>'<br><br>
</ul>
<a name="index"></a>
<p><b>Index</b>
<ul>
<li>On page 437: '<b class="broken">Chimera, 2</b>' has been changed to '<b class="fixed">Camino, 2</b>'<br><br>
</ul>
<br><br>
<!-- ?php require(NOTES); ? -->
<?php $post_to_list=NO; $author='reviewers@mozdev.org'; $target_page='corrections'; require(NOTES); ?>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>