Difference between revisions of "Dive into Mozilla Fixing a Bug Lab"

From CDOT Wiki
Jump to: navigation, search
(Instructions)
 
(2 intermediate revisions by the same user not shown)
Line 16: Line 16:
 
   
 
   
 
  Steps to Reproduce:
 
  Steps to Reproduce:
  1. Open history sidebar
+
  1. Open history sidebar (View > Sidebar > History or CTRL+H)
 
  2. Sort items by date
 
  2. Sort items by date
 
  3. Delete category Today (which is certainly the first one)
 
  3. Delete category Today (which is certainly the first one)
Line 37: Line 37:
 
  Merging differences between 1.5 and 1.4 into nsTreeController.js
 
  Merging differences between 1.5 and 1.4 into nsTreeController.js
  
* Using the debugging tools and techniques we learned earlier, see if you can isolate and fix this bug in nsTreeController.js.
+
* You can then update your browser to include this new file by doing the following:
 +
 
 +
$ cd ../../../''objdir''/toolkit/obsolete
 +
$ make
 +
 
 +
* This will take the various .js files in that directory and create a new .jar file (i.e., a zip file suitable for distribution).
 +
 
 +
* Now, using the debugging tools and techniques we learned earlier, see if you can isolate and fix this bug in '''nsTreeController.js'''.
  
 
'''Try to avoid the temptation to look at the patch until you have finished!'''
 
'''Try to avoid the temptation to look at the patch until you have finished!'''

Latest revision as of 14:32, 1 March 2007

Dive into Mozilla > Dive into Mozilla Day 4 > Fixing a Bug Lab

Overview

This lab is designed to give you first-hand experience trying to fix a JavaScript bug in the browser. You will work on an existing bug that has already been solved. This will allow you to compare your work to that of the fix.

Instructions

  • Read the description of the following bug, and make sure you can reproduce the behaviour in your browser. Use Firefox 2 and not your trunk build to test, since trunk has it fixed:
Deleting first item in History Sidebar causes no item have focus.

Deleting any other item sets focus on the next item after the deleted one (and that is correct).

Reproducible: Always

Steps to Reproduce:
1. Open history sidebar (View > Sidebar > History or CTRL+H)
2. Sort items by date
3. Delete category Today (which is certainly the first one)

You can alternatively use history search and delete fist item found.

Actual Results:  
None of items or categories have focus.

Expected Results:  
Focus should be set on the next item after deleted one.
  • Since the bug has already been fixed, we need to roll-back to an earlier version of the file from CVS. NOTE: at the time of writing (February 28, 2007), the most recent version of nsTreeController.js was 1.5, and we need 1.4:
$ cd mozilla/toolkit/obsolete/content
$ cvs update -j1.5 -j1.4 nsTreeController.js 
RCS file: /cvsroot/mozilla/toolkit/obsolete/content/nsTreeController.js,v
retrieving revision 1.5
retrieving revision 1.4
Merging differences between 1.5 and 1.4 into nsTreeController.js
  • You can then update your browser to include this new file by doing the following:
$ cd ../../../objdir/toolkit/obsolete
$ make
  • This will take the various .js files in that directory and create a new .jar file (i.e., a zip file suitable for distribution).
  • Now, using the debugging tools and techniques we learned earlier, see if you can isolate and fix this bug in nsTreeController.js.

Try to avoid the temptation to look at the patch until you have finished!

Resources