--- books/www/corrections.html 2003/02/17 19:26:42 1.75 +++ books/www/corrections.html 2003/03/19 11:35:08 1.99 @@ -1,6 +1,6 @@

Corrections @@ -12,16 +12,29 @@ section on the chapter pages, or send a href="mailto:reviewers@mozdev.org">reviewers@mozdev.org mailing list.

Note: All errors in the text and examples are shown in red and all corrections are shown in green. +class="fixed">blue.

Preface

@@ -30,12 +43,15 @@ to 'http://www.oreilly. @@ -80,6 +106,16 @@ to 'We've packed a lot
  • On page 35: 'secondLevelNodes[I] = docEl.childNodes[i];' has been changed to 'secondLevelNodes[I] = docEl.childNodes[I];'

    +
  • On page 38: In Example 3-3 the namespace declarations have been changed to (note the addition of quotes and the removal of italics) + + + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:nc="http://home.netscape.com/NC-rdf#"> + + +
  • On page 38: In Example 3-3 '<image src="page1.png">' has been changed to '<image +src="page1.png"/>'

    +
  • On page 40: '<toolbarbutton id="printBtn" label="Open" oncommand="doPrint( );" />' has been changed to '<toolbarbutton id="printBtn" label="Print" oncommand="doPrint( );" >'

    @@ -87,6 +123,9 @@ id="printBtn" label="Print" oncommand="d
  • On page 51: '<decription>The mozdev.org site [...] your own development project</decription>' has been changed to '<description>The mozdev.org site [...] your own development project</description>'

    +
  • On page 54: 'Clicking on the box sets the clicked attribute' has been +changed to 'Clicking on the box sets the checked attribute'

    +
  • On pages 58 and 59: Example 3-15 has been changed to (note the addition of spaces to seperate values) @@ -114,6 +153,11 @@ changed to '<b class="fixed">&lt;descrip </window> +
  • On page 63: 'But there are also CSS versions of these properties that +use the prefix box-pack becomes box-pack when it's defined in CSS, for example.' has been +changed to 'But there are also CSS versions of these properties that +use the prefix box-. pack becomes box-pack when it's defined in CSS, for example.'

    + @@ -125,8 +169,8 @@ changed to '<descrip
  • On page 88: 'these are selectors are identical' has been changed to 'these selectors are identical'

    -
  • On page 109: 'The chome URL that the -moz-binding property points to' has been changed to 'The chrome URL that the -moz-binding property points to'

    +
  • On page 109: 'The chome URL that the -moz-binding property points to' has been changed to 'The chrome URL that the -moz-binding property points to'

    @@ -149,7 +193,6 @@ class="fixed">The chrome URL that the -m
  • On page 135: Example 5-11 has been changed to - <head> <title>Sound Service Play Example</title> <script> @@ -170,7 +213,10 @@ class="fixed">The chrome URL that the -m <form name="form"> <input type="button" value="Play Sound" onclick="play();"> </form> - </ul><li>On page 137: '<b class="broken">var connection = Components.classes ["@mozilla.org/network/ldap-connection;1";</b>' has been changed to + + +
  • On page 137: 'var connection = Components.classes ["@mozilla.org/network/ldap-connection;1";' + has been changed to 'var connection = Components.classes ["@mozilla.org/network/ldap-connection;1"];'

  • @@ -178,46 +224,144 @@ class="fixed">The chrome URL that the -m load('chrome/jslib/jslib.js');'

    + + + +

    Chapter 6 + +

      + +
    • On page 145: Example 6-1 has been changed to
      + + +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. + + +
    + + +

    Chapter 7 + +

      + +
    • On page 181: There are 3 errors in Figure 7-2 ...

      + +1) In the XUL box, 'klabel="Input Field"' should be 'label="Input Field"'

      + +2) In the XBL box, '<binding id+"inputfield">' should be '<binding id="inputfield">'

      + +3) In the XBL box, '<xul:label xbl:inherits="value+label"?>' should be '<xul:label xbl:inherits="value=label"/>'

      +Here is a correct image (Click for bigger version):

      + +Figure 7-2 + +
    • + +
    + +

    Chapter 8

      -
    • On page 211: In 2nd sentence of paragraph 'QueryInterace' has been changed to 'QueryInterface'

      - -
    • On page 222: In Example 8-4 'mName: "a default value"' has been changed to 'mName: "a default -value",'

      +
    • On page 211: In 2nd sentence of paragraph 'QueryInterace' has been +changed to 'QueryInterface'

    • -
    • On page 222: In Example 8-4 +
    • On page 222: In Example 8-4 has been changed to: - - this.myCID, - "My JS Component", - this.myProgID, fileSpec, - location, true, true, - type); - + +function SimpleComponent(){} -has been changed to +SimpleComponent.prototype = { - <xmp class="fixed"> - compMgr.registerComponentWithType( - this.myCID, - "My JS Component", - this.myProgID, fileSpec, - location, true, true, - type); - + get yourName() { return this.mName; }, + set yourName(aName) { return this.mName = aName; }, -
    • On page 222: In Example 8-4 one of the duplicate 'dump(" ***** Registering: Simple JS component! -****\n");' lines has been removed

      + 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 -
    • On page 223: In Example 8-4 one of the duplicate 'if (outer != null)' lines has been removed

      +function NSGetModule(compMgr, fileSpec) { return Module; } + +
    • -
    • On page 239: Example 8-15 has been changed to
      +
    • On page 239: Example 8-15 has been changed to
    • DEPTH = ../../.. @@ -264,31 +408,36 @@ install:: $(TARGETS) <p><b>Chapter 9</b> <ul> - <li>On page 257: In Example 9-7 <br> - '<b><font color="#FF0000">&lt;triple subject=&quot;?listitem&quot;<br> - predicate=&quot; http://xfly.mozdev.org/fly-rdf#location&quot;<br> - object=&quot;?location&quot;/&gt;</font></b>' <br> - has been changed to<br> - '<b><font color="#009900">&lt;triple subject=&quot;?listitem&quot;<br> - predicate=&quot;fly-location#location&quot;<br> - object=&quot;?location&quot;/&gt;</font></b>'</li> + +<li>On page 257: In Example 9-7 + +<xmp class="broken"> + <triple subject="?listitem" + predicate=" http://xfly.mozdev.org/fly-rdf#location" + object="?location"/> + + +has been changed to + + + <triple subject="?listitem" + predicate="fly-location#location" + object="?location"/> + +

    Chapter 10

      -
    • On page 280: In Table 10-3 'Mostly used for retrieving, - datasources,
      - resources, and literals
      .' has been changed to 'Mostly - used for retrieving datasources,
      - resources, and literals
      .'.
      -
      -
    • -
    • On page 297: 'http://www.jslib.mozdev.org' has been - changed to 'http://jslib.mozdev.org'
      -
      -
    • + +
    • On page 280: In Table 10-3 'Mostly used for retrieving, datasources, resources, and literals.' has been +changed to 'Mostly used for retrieving datasources, resources, and literals.'

      + +
    • On page 297: 'http://www.jslib.mozdev.org' has been changed to 'http://jslib.mozdev.org'

      +
    @@ -323,10 +472,12 @@ has been changed to (note the difference print ' ' % form['op3'].value + @@ -341,12 +492,18 @@ class="fixed">http://www.mozilla.org/sou + + +

    Index + +

      + +
    • On page 437: 'Chimera, 2' has been changed to 'Camino, 2'

      + +
    + +

    - - - - -