File:  [mozdev] / books / www / corrections.html
Revision 1.95: download - view: text, annotated - select for diffs - revision graph
Fri Mar 14 15:40:00 2003 UTC (17 years ago) by david
Branches: MAIN
CVS tags: HEAD
updating corrections

    1: <html><style>
    2:   .broken { color: red; }
    3:   .fixed { color: blue; }
    4: </style>
    5: 
    6: <body><p><b>Corrections</b>
    7: 
    8: <p>This page contains a list of corrections to be made in the next printing of
    9: the book.  If you have suggestions for changes or find errors in the text,
   10: feel free open a <a href="bugs.html">bug</a> with a report of the problem, post a message in the User Notes 
   11: section on the chapter pages, or send a message to the <a
   12: href="mailto:reviewers@mozdev.org">reviewers@mozdev.org</a> mailing list.
   13: 
   14: <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
   15: class="fixed">blue</b>.
   16: 
   17: <a name="preface"></a>
   18: <p><b>Preface</b>
   19: 
   20: <ul>
   21: 
   22: <li>On page ix: '<b class="broken">other browsers such as Galeon and Chimera</b>' has been changed to '<b class="fixed">other browsers 
   23: such as Galeon and Camino</b>'<br><br>
   24: 
   25: <li>On page xiv: '<b class="broken">http://www.oreilly.com/mozilla/</b>' has been changed
   26: to '<b class="fixed">http://www.oreilly.com/catalog/mozilla/</b>'<br><br>
   27: 
   28: <li>On page xvii: '<b class="broken">David McNamara, and Mark Hammond</b>' has been changed to '<b class="fixed">David 
   29: McNamara, Mark Hammond, Gary Frederick, and Andreas Halter</b>'<br><br>
   30: 
   31: <li>On page xvii: '<b class="broken">David Hyatt and Mike Pinkerton for the Chimera browser</b>' has been changed to '<b
   32: class="fixed">David Hyatt and Mike Pinkerton for the Camino browser</b>'<br><br>
   33: 
   34: <li>On page xvii: '<b class="broken">including Kim Steckler, Rachel Oeschger, and Priscilla, Dylan, and Devon Collins</b>' has been
   35: changed to '<b class="fixed">including Kim Steckler, Rachel Oeschger, Marjana Molan, Lia Molan King, and Priscilla, Dylan, and Devon
   36: Collins</b>'<br><br>
   37: 
   38: </ul>
   39: 
   40: 
   41: <a name="ch1"></a>
   42: <p><b>Chapter 1</b>
   43: 
   44: <ul>
   45: 
   46: <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 
   47: '<b class="fixed">like Camino (an ultra-fast browser that works only on Mac OS X)</b>'<br><br>
   48: 
   49: <li>On page 7: In sidebar '<b class="broken">Another project, call m/b (short for mozilla/browser), addresses shortcomings</b>' has
   50: been changed to '<b class="fixed">The Phoenix project (http://www.mozilla.org/projects/phoenix/) also addresses
   51: shortcomings</b>'<br><br>
   52: 
   53: <li>On page 7: In sidebar '<b class="broken">Some examples include Chimera (http://chimera.mozdev.org)</b>' has been changed to '<b 
   54: class="fixed">Some examples include Camino (http://www.mozilla.org/projects/camino/)</b>'<br><br>
   55: 
   56: <li>On page 7: '<b class="broken">applications web built using XPFE</b>' has been
   57: changed to '<b class="fixed">applications built using XPFE</b>'<br><br>
   58: 
   59: </ul>
   60: 
   61: 
   62: <a name="ch2"></a>
   63: <p><b>Chapter 2</b>
   64: 
   65: <ul>
   66: 
   67: <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
   68: of the complete xFly application can be found at http://xfly.mozdev.org.</b>'<br><br>
   69: 
   70: <li>On page 12: '<b class="broken">&lt;window
   71: xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"  
   72: /&gt;</b>' has been changed to '<b class="fixed">&lt;window
   73: xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;</b>'<br><br>
   74: 
   75: <li>On page 14: In first code sample from Windows features section, '<b
   76: class="broken">xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;</b>' has been changed to '<b
   77: class="fixed">xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"</b>'<br><br>
   78: 
   79: <li>On page 17: '<b class="broken">selecting File > Open File > from</b>' has been
   80: changed to '<b class="fixed">selecting File > Open File from</b>'<br><br>
   81: 
   82: <li>On page 20: '<b class="broken">CenterWindoOnScreen( ) function</b>' has been changed
   83: to '<b class="fixed">CenterWindowOnScreen( ) function</b>'<br><br>
   84: 
   85: <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
   86: shown in Figure 2-5.</b>' has been changed to '<b class="fixed">Under that directory, create the three new directories, <i>content</i>,
   87: <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
   88: structure.</b>'<br><br>
   89: 
   90: <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>
   91: 
   92: <li>On page 32: In Example 2-15 '<b class="broken">locale,install,url,resource:/chrome/xfly/locale/</b>' has been changed to '<b
   93: class="fixed">locale,install,url,resource:/chrome/xfly/locale/en-US/</b>'<br><br>
   94: 
   95: </ul>
   96: 
   97: 
   98: <a name="ch3"></a>
   99: <p><b>Chapter 3</b>
  100: 
  101: <ul>
  102: 
  103: <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
  104: to '<b class="fixed">We've packed a lot of information in this chapter and it will be a useful reference</b>'<br><br>
  105: 
  106: <li>On page 35: '<b class="broken">secondLevelNodes[I] = docEl.childNodes[i];</b>' has been changed to '<b 
  107: class="fixed">secondLevelNodes[I] = docEl.childNodes[I];</b>'<br><br>
  108: 
  109: <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)
  110: 
  111: <xmp class="fixed">
  112:     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  113:     xmlns:nc="http://home.netscape.com/NC-rdf#">
  114: </xmp>
  115: 
  116: <li>On page 40: '<b class="broken">&lt;toolbarbutton id="printBtn" label="Open"
  117: oncommand="doPrint( );" /&gt</b>' has been changed to '<b class="fixed">&lt;toolbarbutton
  118: id="printBtn" label="Print" oncommand="doPrint( );" &gt</b>'<br><br>
  119: 
  120: <li>On page 51: '<b class="broken">&lt;decription&gt;The mozdev.org site [...] your own development project&lt;/decription&gt;</b>' has been 
  121: changed to '<b class="fixed">&lt;description&gt;The mozdev.org site [...] your own development project&lt;/description&gt;</b>'<br><br>
  122: 
  123: <li>On pages 58 and 59: Example 3-15 has been changed to (note the addition of spaces to seperate values)
  124: 
  125: <xmp class="fixed">
  126: <?xml version="1.0"?>
  127: <window id="hello-goodbye"
  128:     title="Hello Goodbye"
  129:     xmlns:html="http://www.w3.org/1999/xhtml"
  130:     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  131:     style="min-width:100px;min-height:100px;background-color:white;">
  132:   <broadcasterset id="broadcasterset">
  133:     <broadcaster id="cmd_hello" oncommand="alert('Hello There!');"/>
  134:   </broadcasterset>
  135:   <keyset id="keyset">
  136:     <key id="key_h" key="H" observes="cmd_hello" modifiers="accel,shift" />
  137:     <key id="key_g" key="G" command="cmd_goodbye" modifiers="accel,shift" />
  138:   </keyset>
  139:   <commandset id="commandset">
  140:     <command id="cmd_goodbye" oncommand="alert('Goodbye!');" />
  141:   </commandset>
  142:   <spacer flex="1"/>
  143:   <label value="hello/goodbye"/>
  144:   <textbox value="type ctl+shft+h"/>
  145:   <textbox value="type ctl+shft+g"/>
  146:   <spacer flex="1"/>
  147: </window>
  148: </xmp>
  149: 
  150: </ul>
  151: 
  152: 
  153: <a name="ch4"></a>
  154: <p><b>Chapter 4</b>
  155: 
  156: <ul>
  157: 
  158: <li>On page 88: '<b class="broken">these are selectors are identical</b>' has been changed to '<b class="fixed">these selectors are 
  159: identical</b>'<br><br>
  160: 
  161: <li>On page 109: '<b class="broken">The chome URL that the -moz-binding property points to</b>' has been changed to '<b
  162: class="fixed">The chrome URL that the -moz-binding property points to</b>'<br><br>
  163: 
  164: </ul>
  165: 
  166: 
  167: <a name="ch5"></a>
  168: <p><b>Chapter 5</b>
  169: 
  170: <ul>
  171: 
  172: <li>On page 113: Javascript 1.5 reference link in footnote has been changed from 
  173: '<b class="broken">http://developer.netscape.com/docs/manuals/js/core/jsref15/contents.html</b>' to
  174: '<b class="fixed">http://developer.netscape.com/docs/manuals/index.html?content=javascript.html</b>'<br><br>
  175: </li>
  176: 
  177: <li>On page 120: '<b class="broken">&lt;/script.</b>' has been changed to '<b class="fixed">&lt;/script&gt;</b>'<br><br>
  178: </li>
  179: 
  180: <li>On page 120: '<b class="broken">dump(l+'\n');</b>' has been changed to '<b class="fixed">dump(len+'\n');</b>'<br><br>
  181: </li>
  182: 
  183: <li>On page 135: Example 5-11 has been changed to
  184: <xmp class="fixed">
  185: 
  186:   <head>
  187:     <title>Sound Service Play Example</title>
  188:     <script>  
  189:       function play() { 
  190:         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
  191:         var sample = Components.classes["@mozilla.org/sound;1"].createInstance(); 
  192:         sample = sample.QueryInterface(Components.interfaces.nsISound); 
  193:         const SND_NETWORK_STD_CID = "@mozilla.org/network/standard-url;1";
  194:         const SND_I_URL           = "nsIURL";
  195:         const SND_URL             = new  C.Constructor(SND_NETWORK_STD_CID, SND_I_URL);
  196:         var url                   = new SND_URL();
  197:         url.spec                  = 'http://jslib.mozdev.org/test.wav';
  198:         sample.play(url);
  199:       } 
  200:     </script>  
  201:   </head>  
  202:     
  203:     <form name="form">  
  204:       <input type="button" value="Play Sound" onclick="play();">  
  205:     </form>  
  206: 
  207: </xmp>
  208: 
  209: <li>On page 137: '<b class="broken">var connection = Components.classes ["@mozilla.org/network/ldap-connection;1";</b>' 
  210:   has been changed to 
  211: '<b class="fixed">var connection = Components.classes ["@mozilla.org/network/ldap-connection;1"];</b>'<br><br>
  212: </li>
  213: 
  214: <li>On page 140: '<b class="broken">js> load(`chrome/jslib/jslib.js');</b>' has been changed to '<b class="fixed">js>
  215: load('chrome/jslib/jslib.js');</b>'<br><br>
  216: </li>
  217: 
  218: </ul>
  219: 
  220: <a name="ch06"></a>
  221: <p><b>Chapter 6</b>
  222: 
  223: <ul>
  224: 
  225: <li>On page 145: Example 6-1 has been changed to <br/>
  226: 
  227: <xmp class="fixed">
  228: var myFile = "xFly.jar";
  229: initInstall(                      // initialize the installation
  230:   "Install xFly",                 // display name of installation
  231:   "xFly",                         // package name
  232:   "0.0.1",                        // version of install
  233:   1);                             // flags - an optional argument, 
  234:                                   // reserved for future use
  235: f = getFolder("Chrome"); 	  // specify a target directory
  236: setPackageFolder(f);
  237: addFile(myFile);         	  // add software to the installation
  238: registerChrome(
  239:   PACKAGE | DELAYED_CHROME,       // chrome switch (i.e., type)
  240:   getFolder("Chrome","xFly.jar"), // destination of package
  241:   "content/xFly/");               // location of manifest in package
  242: if (0 == getLastError( ))   	  // if there have been no errors:
  243:   performInstall( );        	  // install "xfly.jar"
  244: else                       	  // otherwise
  245:   cancelInstall( );         	  // cancel the installation.
  246: </xmp>
  247: 
  248: </ul>
  249: 
  250: 
  251: <a name="ch08"></a>
  252: <p><b>Chapter 8</b>
  253: 
  254: <ul>
  255: 
  256: <li>On page 211: In 2nd sentence of paragraph '<b class="broken">QueryInterace</b>' has been 
  257: changed to '<b class="fixed">QueryInterface</b>'<br><br></li>
  258: 
  259: <li>On page 222: In Example 8-4 '<b class="broken">mName: "a default value"</b>' has been 
  260: changed to '<b class="fixed">mName: "a default value",</b>'<br><br></li>
  261: 
  262: <li>On page 222: In Example 8-4:
  263: 
  264:             <xmp class="broken">
  265:               this.myCID,
  266:               "My JS Component",
  267:               this.myProgID, fileSpec,
  268:               location, true, true,
  269:               type);
  270:             </xmp>            
  271: 
  272: has been changed to
  273: 
  274:             <xmp class="fixed">            
  275:               compMgr.registerComponentWithType(
  276:               this.myCID,
  277:               "My JS Component",
  278:               this.myProgID, fileSpec,
  279:               location, true, true,
  280:               type);
  281:             </xmp>            
  282: 
  283: </li>
  284: 
  285: <li>On page 222: In Example 8-4 one of the duplicate '<b class="broken">dump(" ***** Registering: Simple JS component!
  286: ****\n");</b>' lines has been removed<br><br></li>
  287: 
  288: <li>On page 222: In Example 8-4 has been changed to:
  289: 
  290: <xmp>
  291: 
  292: function SimpleComponent(){}
  293: 
  294: SimpleComponent.prototype = {
  295: 
  296:     get yourName()        { return this.mName; },
  297:     set yourName(aName)   { return this.mName = aName; },
  298: 
  299:     write: function () { dump("Hello " + this.mName + "\n"); },
  300:     change: function (aValue) { this.mName = aValue; },
  301:     mName: "a default value",
  302: 
  303:     QueryInterface: function (iid) {
  304:         if (!iid.equals(Components.interfaces.nsISimple)
  305:             && !iid.equals(Components.interfaces.nsISupports))
  306:         {
  307:             throw Components.results.NS_ERROR_NO_INTERFACE;
  308:         }
  309:         return this;
  310:     }
  311: }
  312: 
  313: var Module = {
  314:     firstTime: true,
  315: 
  316:     registerSelf: function (compMgr, fileSpec, location, type) {
  317:         if (this.firstTime) {
  318:             dump("*** Deferring registration of simple JS components\n");
  319:             this.firstTime = false;
  320:             throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
  321:         }
  322:         debug("*** Registering sample JS components\n");
  323:         compMgr =
  324: compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  325:         compMgr.registerFactoryLocation(this.myCID,
  326:                                         "Simple JS Component",
  327:                                         this.myProgID,
  328:                                         fileSpec,
  329:                                         location,
  330:                                         type);
  331:     },
  332: 
  333:     getClassObject : function (compMgr, cid, iid) {
  334:         if (!cid.equals(this.myCID))
  335:         throw Components.results.NS_ERROR_NO_INTERFACE
  336:         if (!iid.equals(Components.interfaces.nsIFactory))
  337:         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  338:         return this.myFactory;
  339:     },
  340: 
  341:     myCID: Components.ID("{98aa9afd-8b08-415b-91ed-01916a130d16}"),
  342:     myProgID: "@mozilla.org/js_simple_component;1",
  343: 
  344:     myFactory: {
  345:         createInstance: function (outer, iid) {
  346:             dump("CI: " + iid + "\n");
  347:             if (outer != null)
  348:             throw Components.results.NS_ERROR_NO_AGGREGATION;
  349:             return (new SimpleComponent()).QueryInterface(iid);
  350:         }
  351:     },
  352: 
  353:     canUnload: function(compMgr) {
  354:         dump("****** Unloading: Simple JS component! ****** \n");
  355:         return true;
  356:     }
  357: }; // END Module
  358: 
  359: function NSGetModule(compMgr, fileSpec) { return Module; }
  360: 
  361: </xmp>
  362: <br><br>
  363: </li>
  364: 
  365: <li>On page 223: In Example 8-4 one of the duplicate '<b class="broken">if (outer != null)</b>' lines has been removed<br><br>
  366: 
  367: <li>On page 222: In Example 8-4 has been changed to:</li>
  368: <li>On page 239: Example 8-15 has been changed to <br/></li>
  369: 
  370: <xmp class="fixed">
  371: DEPTH         = ../../..
  372: topsrcdir     = ../../..
  373: srcdir        = .
  374: VPATH         = .
  375: 
  376: include $(DEPTH)/config/autoconf.mk
  377: 
  378: MODULE        = xpcom
  379: XPIDL_MODULE  = simple
  380: LIBRARY_NAME  = simple
  381: IS_COMPONENT  = 1
  382: MODULE_NAME   = nsSimpleModule
  383: REQUIRES      = string \
  384:                 xpcom \
  385:                 $(NULL)
  386: 
  387: 
  388: CPPSRCS   =              \
  389:     nsSimple.cpp         \
  390:     nsSimpleModule.cpp   \
  391:     $(NULL)
  392: 
  393: XPIDLSRCS = nsISimple.idl
  394: 
  395: include $(topsrcdir)/config/config.mk
  396: 
  397: LIBS    +=        \
  398:     $(XPCOM_LIBS) \
  399:     $(NSPR_LIBS)  \
  400:     $(NULL)
  401: 
  402: include $(topsrcdir)/config/rules.mk
  403: 
  404: EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
  405: 
  406: install:: $(TARGETS)
  407: </xmp>
  408: 
  409: </ul>
  410: 
  411: <a name="ch9"></a>
  412: <p><b>Chapter 9</b>
  413: 
  414: <ul>
  415: 
  416: <li>On page 257: In Example 9-7
  417: 
  418: <xmp class="broken">
  419: 	<triple subject="?listitem"
  420:     		predicate=" http://xfly.mozdev.org/fly-rdf#location"
  421:     		object="?location"/>
  422: </xmp>
  423: 
  424: has been changed to
  425: 
  426: <xmp class="fixed">
  427:         <triple subject="?listitem"
  428:     		predicate="fly-location#location"
  429:                 object="?location"/>
  430: </xmp>
  431: 
  432: </ul>
  433: 
  434: <a name="ch10"></a>
  435: <p><b>Chapter 10</b>
  436: 
  437: <ul>
  438: 
  439: <li>On page 280: In Table 10-3 '<b class="broken">Mostly used for retrieving, datasources, resources, and literals.</b>' has been
  440: changed to '<b class="fixed">Mostly used for retrieving datasources, resources, and literals.</b>'<br><br>
  441: 
  442: <li>On page 297: '<b class="broken">http://www.jslib.mozdev.org</b>' has been changed to '<b
  443: class="fixed">http://jslib.mozdev.org</b>'<br><br>
  444: 
  445: </ul>
  446: 
  447: 
  448: <a name="ch11"></a>
  449: <p><b>Chapter 11</b>
  450: 
  451: <ul> 
  452: <li>On page 314: In Example 11-5 and Example 11-6 '<b class="broken">var linetext =
  453: document.createTextNode(messageParagraphs[i]);</b>' has been changed to '<b class="fixed">var linetext =
  454: document.createTextNode(lines[i]);</b>'<br><br>
  455: </ul>
  456: 
  457: 
  458: <a name="ch12"></a>
  459: <p><b>Chapter 12</b>
  460: 
  461: <ul>
  462: 
  463: <li>On page 336: In Example 12-6
  464: 
  465: <xmp class="broken">
  466:  print `  <checkbox label="%s" />' % form['op1'].value
  467:  print `  <checkbox label="%s" />' % form['op2'].value
  468:    print `  <checkbox label="%s" />' % form['op3'].value
  469: </xmp>
  470: 
  471: has been changed to (note the difference in indentation and in using a single quote versus a backtick)
  472: 
  473: <xmp class="fixed">
  474:    print '  <checkbox label="%s" />' % form['op1'].value
  475:    print '  <checkbox label="%s" />' % form['op2'].value
  476:    print '  <checkbox label="%s" />' % form['op3'].value
  477: </xmp>
  478: 
  479: <!--
  480: <li>On page 339: A new 'Certificate Authorities and Digital
  481: Signatures' section is being written with drafts available on <a
  482: href="http://certs.mozdev.org">http://certs.mozdev.org</a><br><br>
  483: </li>
  484: -->
  485: 
  486: </ul>
  487: 
  488: 
  489: <a name="appa"></a>
  490: <p><b>Appendix A</b>
  491: 
  492: <ul>
  493: 
  494: <li>On page 365: '<b class="broken">http://www.mozilla.org/source.tml</b>' has been changed to '<b
  495: class="fixed">http://www.mozilla.org/source.html</b>'<br><br>
  496: 
  497: </ul>
  498: 
  499: 
  500: <a name="index"></a>
  501: <p><b>Index</b>
  502: 
  503: <ul>
  504: 
  505: <li>On page 437: '<b class="broken">Chimera, 2</b>' has been changed to '<b class="fixed">Camino, 2</b>'<br><br>
  506: 
  507: </ul>
  508: 
  509: 
  510: <br><br>
  511: 
  512: <!-- ?php require(NOTES); ? -->
  513: <?php $post_to_list=NO; $author='reviewers@mozdev.org'; $target_page='corrections'; require(NOTES); ?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>