File:  [mozdev] / books / www / corrections.html
Revision 1.99: download - view: text, annotated - select for diffs - revision graph
Wed Mar 19 11:35:08 2003 UTC (16 years, 7 months ago) by brian
Branches: MAIN
CVS tags: HEAD
Fixes for bugs 2639, 2640, 2817 and 2838

    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 38: In Example 3-3 '<b class="broken">&lt;image src="page1.png"&gt;</b>' has been changed to '<b class="fixed">&lt;image 
  117: src="page1.png"/&gt;</b>'<br><br>
  118: 
  119: <li>On page 40: '<b class="broken">&lt;toolbarbutton id="printBtn" label="Open"
  120: oncommand="doPrint( );" /&gt</b>' has been changed to '<b class="fixed">&lt;toolbarbutton
  121: id="printBtn" label="Print" oncommand="doPrint( );" &gt</b>'<br><br>
  122: 
  123: <li>On page 51: '<b class="broken">&lt;decription&gt;The mozdev.org site [...] your own development project&lt;/decription&gt;</b>' has been 
  124: changed to '<b class="fixed">&lt;description&gt;The mozdev.org site [...] your own development project&lt;/description&gt;</b>'<br><br>
  125: 
  126: <li>On page 54: '<b class="broken">Clicking on the box sets the <tt>clicked</tt> attribute</b>' has been 
  127: changed to '<b class="fixed">Clicking on the box sets the <tt>checked</tt> attribute</b>'<br><br>
  128: 
  129: <li>On pages 58 and 59: Example 3-15 has been changed to (note the addition of spaces to seperate values)
  130: 
  131: <xmp class="fixed">
  132: <?xml version="1.0"?>
  133: <window id="hello-goodbye"
  134:     title="Hello Goodbye"
  135:     xmlns:html="http://www.w3.org/1999/xhtml"
  136:     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  137:     style="min-width:100px;min-height:100px;background-color:white;">
  138:   <broadcasterset id="broadcasterset">
  139:     <broadcaster id="cmd_hello" oncommand="alert('Hello There!');"/>
  140:   </broadcasterset>
  141:   <keyset id="keyset">
  142:     <key id="key_h" key="H" observes="cmd_hello" modifiers="accel,shift" />
  143:     <key id="key_g" key="G" command="cmd_goodbye" modifiers="accel,shift" />
  144:   </keyset>
  145:   <commandset id="commandset">
  146:     <command id="cmd_goodbye" oncommand="alert('Goodbye!');" />
  147:   </commandset>
  148:   <spacer flex="1"/>
  149:   <label value="hello/goodbye"/>
  150:   <textbox value="type ctl+shft+h"/>
  151:   <textbox value="type ctl+shft+g"/>
  152:   <spacer flex="1"/>
  153: </window>
  154: </xmp>
  155: 
  156: <li>On page 63: '<b class="broken">But there are also CSS versions of these properties that 
  157: use the prefix <tt>box-pack</tt> becomes <tt>box-pack</tt> when it's defined in CSS, for example.</b>' has been 
  158: changed to '<b class="fixed">But there are also CSS versions of these properties that 
  159: 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>
  160: 
  161: </ul>
  162: 
  163: 
  164: <a name="ch4"></a>
  165: <p><b>Chapter 4</b>
  166: 
  167: <ul>
  168: 
  169: <li>On page 88: '<b class="broken">these are selectors are identical</b>' has been changed to '<b class="fixed">these selectors are 
  170: identical</b>'<br><br>
  171: 
  172: <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
  173: class="fixed">The <i>chrome</i> URL that the -moz-binding property points to</b>'<br><br>
  174: 
  175: </ul>
  176: 
  177: 
  178: <a name="ch5"></a>
  179: <p><b>Chapter 5</b>
  180: 
  181: <ul>
  182: 
  183: <li>On page 113: Javascript 1.5 reference link in footnote has been changed from 
  184: '<b class="broken">http://developer.netscape.com/docs/manuals/js/core/jsref15/contents.html</b>' to
  185: '<b class="fixed">http://developer.netscape.com/docs/manuals/index.html?content=javascript.html</b>'<br><br>
  186: </li>
  187: 
  188: <li>On page 120: '<b class="broken">&lt;/script.</b>' has been changed to '<b class="fixed">&lt;/script&gt;</b>'<br><br>
  189: </li>
  190: 
  191: <li>On page 120: '<b class="broken">dump(l+'\n');</b>' has been changed to '<b class="fixed">dump(len+'\n');</b>'<br><br>
  192: </li>
  193: 
  194: <li>On page 135: Example 5-11 has been changed to
  195: <xmp class="fixed">
  196:   <head>
  197:     <title>Sound Service Play Example</title>
  198:     <script>  
  199:       function play() { 
  200:         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
  201:         var sample = Components.classes["@mozilla.org/sound;1"].createInstance(); 
  202:         sample = sample.QueryInterface(Components.interfaces.nsISound); 
  203:         const SND_NETWORK_STD_CID = "@mozilla.org/network/standard-url;1";
  204:         const SND_I_URL           = "nsIURL";
  205:         const SND_URL             = new  C.Constructor(SND_NETWORK_STD_CID, SND_I_URL);
  206:         var url                   = new SND_URL();
  207:         url.spec                  = 'http://jslib.mozdev.org/test.wav';
  208:         sample.play(url);
  209:       } 
  210:     </script>  
  211:   </head>  
  212:     
  213:     <form name="form">  
  214:       <input type="button" value="Play Sound" onclick="play();">  
  215:     </form>  
  216: </xmp>
  217: 
  218: <li>On page 137: '<b class="broken">var connection = Components.classes ["@mozilla.org/network/ldap-connection;1";</b>' 
  219:   has been changed to 
  220: '<b class="fixed">var connection = Components.classes ["@mozilla.org/network/ldap-connection;1"];</b>'<br><br>
  221: </li>
  222: 
  223: <li>On page 140: '<b class="broken">js> load(`chrome/jslib/jslib.js');</b>' has been changed to '<b class="fixed">js>
  224: load('chrome/jslib/jslib.js');</b>'<br><br>
  225: </li>
  226: 
  227: </ul>
  228: 
  229: <a name="ch06"></a>
  230: <p><b>Chapter 6</b>
  231: 
  232: <ul>
  233: 
  234: <li>On page 145: Example 6-1 has been changed to <br/>
  235: 
  236: <xmp class="fixed">
  237: var myFile = "xFly.jar";
  238: initInstall(                      // initialize the installation
  239:   "Install xFly",                 // display name of installation
  240:   "xFly",                         // package name
  241:   "0.0.1",                        // version of install
  242:   1);                             // flags - an optional argument, 
  243:                                   // reserved for future use
  244: f = getFolder("Chrome"); 	  // specify a target directory
  245: setPackageFolder(f);
  246: addFile(myFile);         	  // add software to the installation
  247: registerChrome(
  248:   PACKAGE | DELAYED_CHROME,       // chrome switch (i.e., type)
  249:   getFolder("Chrome","xFly.jar"), // destination of package
  250:   "content/xFly/");               // location of manifest in package
  251: if (0 == getLastError( ))   	  // if there have been no errors:
  252:   performInstall( );        	  // install "xfly.jar"
  253: else                       	  // otherwise
  254:   cancelInstall( );         	  // cancel the installation.
  255: </xmp>
  256: 
  257: </ul>
  258: 
  259: <a name="ch07"></a>
  260: <p><b>Chapter 7</b>
  261: 
  262: <ul>
  263: 
  264: <li>On page 181: There are 3 errors in Figure 7-2 ...<br><br>
  265: 
  266: 1)  In the XUL box, '<b class="broken">klabel="Input Field"</b>' should be '<b class="fixed">label="Input Field"</b>'<br><br>
  267: 
  268: 2)  In the XBL box, '<b class="broken">&lt;binding id+"inputfield"&gt;</b>' should be '<b class="fixed">&lt;binding id="inputfield"&gt;</b>'<br><br>
  269: 
  270: 3)  In the XBL box, '<b class="broken">&lt;xul:label xbl:inherits="value+label"?&gt;</b>' should be '<b class="fixed">&lt;xul:label xbl:inherits="value=label"/&gt;</b>'<br><br>
  271: 
  272: Here is a correct image <b>(Click for bigger version)</b>:<br><br>
  273: 
  274: <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>
  275: 
  276: </li>
  277: 
  278: </ul>
  279: 
  280: </p>
  281: 
  282: <a name="ch08"></a>
  283: <p><b>Chapter 8</b>
  284: 
  285: <ul>
  286: 
  287: <li>On page 211: In 2nd sentence of paragraph '<b class="broken">QueryInterace</b>' has been 
  288: changed to '<b class="fixed">QueryInterface</b>'<br><br></li>
  289: 
  290: <li>On page 222: In Example 8-4 has been changed to:
  291: 
  292: <xmp class="fixed">
  293: function SimpleComponent(){}
  294: 
  295: SimpleComponent.prototype = {
  296: 
  297:     get yourName()        { return this.mName; },
  298:     set yourName(aName)   { return this.mName = aName; },
  299: 
  300:     write: function () { dump("Hello " + this.mName + "\n"); },
  301:     change: function (aValue) { this.mName = aValue; },
  302:     mName: "a default value",
  303: 
  304:     QueryInterface: function (iid) {
  305:         if (!iid.equals(Components.interfaces.nsISimple)
  306:             && !iid.equals(Components.interfaces.nsISupports))
  307:         {
  308:             throw Components.results.NS_ERROR_NO_INTERFACE;
  309:         }
  310:         return this;
  311:     }
  312: }
  313: 
  314: var Module = {
  315:     firstTime: true,
  316: 
  317:     registerSelf: function (compMgr, fileSpec, location, type) {
  318:         if (this.firstTime) {
  319:             dump("*** Deferring registration of simple JS components\n");
  320:             this.firstTime = false;
  321:             throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
  322:         }
  323:         debug("*** Registering sample JS components\n");
  324:         compMgr =
  325: compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  326:         compMgr.registerFactoryLocation(this.myCID,
  327:                                         "Simple JS Component",
  328:                                         this.myProgID,
  329:                                         fileSpec,
  330:                                         location,
  331:                                         type);
  332:     },
  333: 
  334:     getClassObject : function (compMgr, cid, iid) {
  335:         if (!cid.equals(this.myCID))
  336:         throw Components.results.NS_ERROR_NO_INTERFACE
  337:         if (!iid.equals(Components.interfaces.nsIFactory))
  338:         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  339:         return this.myFactory;
  340:     },
  341: 
  342:     myCID: Components.ID("{98aa9afd-8b08-415b-91ed-01916a130d16}"),
  343:     myProgID: "@mozilla.org/js_simple_component;1",
  344: 
  345:     myFactory: {
  346:         createInstance: function (outer, iid) {
  347:             dump("CI: " + iid + "\n");
  348:             if (outer != null)
  349:             throw Components.results.NS_ERROR_NO_AGGREGATION;
  350:             return (new SimpleComponent()).QueryInterface(iid);
  351:         }
  352:     },
  353: 
  354:     canUnload: function(compMgr) {
  355:         dump("****** Unloading: Simple JS component! ****** \n");
  356:         return true;
  357:     }
  358: }; // END Module
  359: 
  360: function NSGetModule(compMgr, fileSpec) { return Module; }
  361: </xmp>
  362: </li>
  363: 
  364: <li>On page 239: Example 8-15 has been changed to <br/></li>
  365: 
  366: <xmp class="fixed">
  367: DEPTH         = ../../..
  368: topsrcdir     = ../../..
  369: srcdir        = .
  370: VPATH         = .
  371: 
  372: include $(DEPTH)/config/autoconf.mk
  373: 
  374: MODULE        = xpcom
  375: XPIDL_MODULE  = simple
  376: LIBRARY_NAME  = simple
  377: IS_COMPONENT  = 1
  378: MODULE_NAME   = nsSimpleModule
  379: REQUIRES      = string \
  380:                 xpcom \
  381:                 $(NULL)
  382: 
  383: 
  384: CPPSRCS   =              \
  385:     nsSimple.cpp         \
  386:     nsSimpleModule.cpp   \
  387:     $(NULL)
  388: 
  389: XPIDLSRCS = nsISimple.idl
  390: 
  391: include $(topsrcdir)/config/config.mk
  392: 
  393: LIBS    +=        \
  394:     $(XPCOM_LIBS) \
  395:     $(NSPR_LIBS)  \
  396:     $(NULL)
  397: 
  398: include $(topsrcdir)/config/rules.mk
  399: 
  400: EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
  401: 
  402: install:: $(TARGETS)
  403: </xmp>
  404: 
  405: </ul>
  406: 
  407: <a name="ch9"></a>
  408: <p><b>Chapter 9</b>
  409: 
  410: <ul>
  411: 
  412: <li>On page 257: In Example 9-7
  413: 
  414: <xmp class="broken">
  415: 	<triple subject="?listitem"
  416:     		predicate=" http://xfly.mozdev.org/fly-rdf#location"
  417:     		object="?location"/>
  418: </xmp>
  419: 
  420: has been changed to
  421: 
  422: <xmp class="fixed">
  423:         <triple subject="?listitem"
  424:     		predicate="fly-location#location"
  425:                 object="?location"/>
  426: </xmp>
  427: 
  428: </ul>
  429: 
  430: <a name="ch10"></a>
  431: <p><b>Chapter 10</b>
  432: 
  433: <ul>
  434: 
  435: <li>On page 280: In Table 10-3 '<b class="broken">Mostly used for retrieving, datasources, resources, and literals.</b>' has been
  436: changed to '<b class="fixed">Mostly used for retrieving datasources, resources, and literals.</b>'<br><br>
  437: 
  438: <li>On page 297: '<b class="broken">http://www.jslib.mozdev.org</b>' has been changed to '<b
  439: class="fixed">http://jslib.mozdev.org</b>'<br><br>
  440: 
  441: </ul>
  442: 
  443: 
  444: <a name="ch11"></a>
  445: <p><b>Chapter 11</b>
  446: 
  447: <ul> 
  448: <li>On page 314: In Example 11-5 and Example 11-6 '<b class="broken">var linetext =
  449: document.createTextNode(messageParagraphs[i]);</b>' has been changed to '<b class="fixed">var linetext =
  450: document.createTextNode(lines[i]);</b>'<br><br>
  451: </ul>
  452: 
  453: 
  454: <a name="ch12"></a>
  455: <p><b>Chapter 12</b>
  456: 
  457: <ul>
  458: 
  459: <li>On page 336: In Example 12-6
  460: 
  461: <xmp class="broken">
  462:  print `  <checkbox label="%s" />' % form['op1'].value
  463:  print `  <checkbox label="%s" />' % form['op2'].value
  464:    print `  <checkbox label="%s" />' % form['op3'].value
  465: </xmp>
  466: 
  467: has been changed to (note the difference in indentation and in using a single quote versus a backtick)
  468: 
  469: <xmp class="fixed">
  470:    print '  <checkbox label="%s" />' % form['op1'].value
  471:    print '  <checkbox label="%s" />' % form['op2'].value
  472:    print '  <checkbox label="%s" />' % form['op3'].value
  473: </xmp>
  474: 
  475: <!--
  476: <li>On page 339: A new 'Certificate Authorities and Digital
  477: Signatures' section is being written with drafts available on <a
  478: href="http://certs.mozdev.org">http://certs.mozdev.org</a><br><br>
  479: </li>
  480: -->
  481: 
  482: </ul>
  483: 
  484: 
  485: <a name="appa"></a>
  486: <p><b>Appendix A</b>
  487: 
  488: <ul>
  489: 
  490: <li>On page 365: '<b class="broken">http://www.mozilla.org/source.tml</b>' has been changed to '<b
  491: class="fixed">http://www.mozilla.org/source.html</b>'<br><br>
  492: 
  493: </ul>
  494: 
  495: 
  496: <a name="index"></a>
  497: <p><b>Index</b>
  498: 
  499: <ul>
  500: 
  501: <li>On page 437: '<b class="broken">Chimera, 2</b>' has been changed to '<b class="fixed">Camino, 2</b>'<br><br>
  502: 
  503: </ul>
  504: 
  505: 
  506: <br><br>
  507: 
  508: <!-- ?php require(NOTES); ? -->
  509: <?php $post_to_list=NO; $author='reviewers@mozdev.org'; $target_page='corrections'; require(NOTES); ?>

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