--- books/www/corrections.html 2002/12/10 17:12:51 1.46 +++ books/www/corrections.html 2003/04/25 15:42:55 1.123 @@ -1,124 +1,418 @@ -

Corrections + + +

Corrections

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 bug with a report of the problem, post a message in the User Notes section on the chapter pages, or send a message to the reviewers@mozdev.org mailing list. +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 blue. - +

Preface

- +

Chapter 1

- +

Chapter 2

- +

Chapter 3

+ + + +

Chapter 4 + +

- + +

Chapter 5

- -

Chapter 8 + +

Chapter 6

+ + +

Chapter 7 + +

-
  • On page 239: Example 8-15 has been changed to
    +

    - +<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; } + +
  • + +
  • On page 237: Example 8-13, line 9 + + NS_INIT_REFCNT( ); // has been depricated use NS_INIT_ISUPPORTS() + mValue = PL_strdup("default value"); + +has been changed to + + // NS_INIT_REFCNT( ); // has been depricated use NS_INIT_ISUPPORTS() + NS_INIT_ISUPPORTS(); + mValue = PL_strdup("default value"); + +
    +
  • + +
  • On page 239: Example 8-15 has been changed to
  • + + DEPTH = ../../.. topsrcdir = ../../.. srcdir = . @@ -159,51 +453,260 @@ install:: $(TARGETS) </ul> +<a name="ch9"></a> +<p><b>Chapter 9</b> + +<ul> + +<li>On page 247: '<b class="broken">When it appears inside the &lt;template&gt;, the &lt;listbox&gt; tag has two special attributes.</b>' +has been changed to '<b class="fixed">The &lt;listbox&gt; gains two special attributes when it contains a &lt;template&gt;.</b>' +<br><br> + +<li>On page 250: '<b class="broken">"Using Data for Style,"</b>' has been changed to '<b class="fixed">"Using Data for Style",</b>' +<br><br> + +<li>On page 254: Example 9-5 + +<xmp class="broken"> + <rdf:Description about="urn:root"> + <fly:list</td>> + <rdf:Seq> + <rdf:li> + <rdf:Description ID="House"> + <fly:label</td>>House</fly:label> + <fly:list</td>> + <rdf:Seq> + <rdf:li> + <rdf:Description about="musca_autumnalis" + fly:label</td>="Face Fly"/> + </rdf:li> + <rdf:Seq> + </fly:list> + </rdf:li> + </rdf:Seq> + </fly:list> + </rdf:Description> + + +has been changed to + + + <rdf:Description about="urn:root"> + <fly:list</td>> + <rdf:Seq> + <rdf:li> + <rdf:Description ID="House"> + <fly:label</td>>House</fly:label> + </rdf:Description> + <fly:list</td> + <rdf:Seq> + <rdf:li> + <rdf:Description about="musca_autumnalis" + fly:label</td>="Face Fly"/> + </rdf:li> + <rdf:Seq> + </fly:list> + </rdf:li> + </rdf:Seq> + </fly:list> + </rdf:Description> + + +
  • On page 255: Example 9-6 + + + <treecols> + <treecol id="LabelCol" flex="1" sort="?label" label="Name" + primary="true" /> + <treecol id="LoCol" flex="1" sort="?location" label="Location"/> + <treecol id="ColCol" flex="1" sort="?color" label="Color"/> + </treecols> + + +has been changed to + + + <treecols> + <treecol id="LabelCol" flex="1" + sort="rdf:http://xfly.mozdev.org/fly-rdf#label" + class="sortDirectionIndicator" primary="true" label="Name"/> + <treecol id="LoCol" flex="1" + sort="rdf:http://xfly.mozdev.org/fly-rdf#location" + label="Location"/> + <treecol id="ColCol" flex="1" + sort="rdf:http://xfly.mozdev.org/fly-rdf#color" + label="Color"/> + </treecols> + + +
  • On page 257: In Example 9-7 + + + <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"/> + + +
  • On page 258: 'The most important additions to Example 9-7 are the +container="?uri" member="?listitem" attributes on the <template>' has been +changed to 'The most important inclusions to Example 9-7 are the +container="?uri" member="?listitem" attributes on the <template>' +

    + + + +

    Chapter 10

    + + + +

    Chapter 11 + +

    - +

    Chapter 12

    - +

    + +

    Appendix A

    + +

    Index + +

    + +

    - - +