Permalink
Browse files

last changes of firebug/master is merged now.

  • Loading branch information...
farshidbeheshti committed Jun 21, 2012
2 parents 2262701 + 60c15cc commit 9796f0ca41ff620db6d3e9d322514363bec354e2
Showing with 8,256 additions and 5,403 deletions.
  1. +2 −0 .gitignore
  2. +7 −2 extension/bootstrap.js
  3. +14 −11 extension/chrome.bz.tpl.manifest
  4. +1 −1 extension/chrome.manifest
  5. +10 −2 extension/content/firebug/chrome/activation.js
  6. +3 −1 extension/content/firebug/chrome/chrome.js
  7. +1 −0 extension/content/firebug/chrome/panelActivation.js
  8. +2 −2 extension/content/firebug/chrome/reps.js
  9. +27 −8 extension/content/firebug/chrome/tabWatcher.js
  10. +53 −14 extension/content/firebug/console/autoCompleter.js
  11. +1 −1 extension/content/firebug/console/console.js
  12. +3 −0 extension/content/firebug/console/consolePanel.js
  13. +16 −47 extension/content/firebug/cookies/breakpoints.js
  14. +1 −2 extension/content/firebug/cookies/cookie.js
  15. +71 −47 extension/content/firebug/cookies/cookieModule.js
  16. +44 −12 extension/content/firebug/cookies/cookieObserver.js
  17. +38 −31 extension/content/firebug/cookies/cookiePanel.js
  18. +27 −27 extension/content/firebug/cookies/cookiePanel.xul
  19. +11 −11 extension/content/firebug/cookies/cookiePermissions.js
  20. +76 −65 extension/content/firebug/cookies/cookieReps.js
  21. +10 −4 extension/content/firebug/cookies/editCookie.js
  22. +10 −10 extension/content/firebug/cookies/editCookie.xul
  23. +1 −1 extension/content/firebug/cookies/headerResizer.js
  24. +2 −1 extension/content/firebug/cookies/httpObserver.js
  25. +11 −2 extension/content/firebug/css/computedPanel.js
  26. +30 −16 extension/content/firebug/css/cssModule.js
  27. +154 −45 extension/content/firebug/css/cssPanel.js
  28. +2 −1 extension/content/firebug/css/cssReps.js
  29. +21 −14 extension/content/firebug/css/stylePanel.js
  30. +8 −5 extension/content/firebug/dom/domBreakpointGroup.js
  31. +33 −2 extension/content/firebug/editor/editor.js
  32. +13 −1 extension/content/firebug/firebug.css
  33. +41 −20 extension/content/firebug/firebug.js
  34. +4 −1 extension/content/firebug/firefox/bindings.xml
  35. +23 −29 extension/content/firebug/firefox/browserOverlay.js
  36. +13 −19 extension/content/firebug/firefox/start-button/startButtonOverlay.js
  37. +8 −5 extension/content/firebug/html/htmlPanel.js
  38. +63 −2 extension/content/firebug/js/breakpoint.js
  39. +7 −5 extension/content/firebug/js/debugger.js
  40. +2 −2 extension/content/firebug/js/scriptPanel.js
  41. +6 −2 extension/content/firebug/js/sourceFile.js
  42. +518 −247 extension/content/firebug/lib/css.js
  43. +2 −2 extension/content/firebug/lib/dom.js
  44. +7 −3 extension/content/firebug/lib/options.js
  45. +8 −5 extension/content/firebug/net/netDebugger.js
  46. +4 −3 extension/content/firebug/net/netPanel.js
  47. +24 −3 extension/content/firebug/net/netReps.js
  48. +2 −2 extension/defaults/preferences/cookies.js
  49. +1 −1 extension/defaults/preferences/firebug.js
  50. +42 −42 extension/locale/ca-AD/cookies.properties
  51. +120 −120 extension/locale/cs/cookies.properties
  52. +194 −191 extension/locale/de/cookies.properties
  53. +3 −3 extension/locale/de/firebug-amo.properties
  54. +510 −135 extension/locale/de/firebug.properties
  55. +198 −207 extension/locale/en-US/cookies.properties
  56. +21 −5 extension/locale/en-US/firebug.properties
  57. +193 −193 extension/locale/es-AR/cookies.properties
  58. +110 −110 extension/locale/es-ES/cookies.properties
  59. +110 −110 extension/locale/fr/cookies.properties
  60. +120 −120 extension/locale/hu-HU/cookies.properties
  61. +193 −193 extension/locale/it/cookies.properties
  62. +120 −120 extension/locale/ja-JP/cookies.properties
  63. +110 −110 extension/locale/ko-KR/cookies.properties
  64. +193 −193 extension/locale/nl/cookies.properties
  65. +262 −122 extension/locale/pl/cookies.properties
  66. +781 −406 extension/locale/pl/firebug.properties
  67. +106 −106 extension/locale/pt-BR/cookies.properties
  68. +110 −110 extension/locale/pt-PT/cookies.properties
  69. +106 −106 extension/locale/ro-RO/cookies.properties
  70. +261 −121 extension/locale/ru/cookies.properties
  71. +3 −3 extension/locale/ru/firebug-amo.properties
  72. +1 −0 extension/locale/ru/firebug-tracing.properties
  73. +788 −291 extension/locale/ru/firebug.properties
  74. +120 −120 extension/locale/sv-SE/cookies.properties
  75. +0 −112 extension/locale/tr-TR/cookies.properties
  76. +112 −0 extension/locale/tr/cookies.properties
  77. 0 extension/locale/{tr-TR → tr}/firebug.properties
  78. +120 −120 extension/locale/uk-UA/cookies.properties
  79. +120 −120 extension/locale/zh-CN/cookies.properties
  80. +195 −329 extension/locale/zh-TW/cookies.properties
  81. +3 −3 extension/locale/zh-TW/firebug-amo.properties
  82. +3 −3 extension/locale/zh-TW/firebug-tracing.properties
  83. +754 −379 extension/locale/zh-TW/firebug.properties
  84. +44 −10 extension/modules/firebug-service.js
  85. +132 −0 extension/modules/gcli.js
  86. +8 −1 extension/modules/locale.js
  87. +1 −0 extension/modules/prefLoader.js
  88. +3 −3 extension/skin/classic/breakpoint.css
  89. +24 −23 extension/skin/classic/cookies/cookies.css
  90. 0 extension/skin/classic/cookies/{firecookieTrace.css → trace.css}
  91. +4 −0 extension/skin/classic/net.css
  92. +30 −2 tests/FBTest/content/testCouchUploader.js
  93. +33 −0 tests/FBTest/content/userMessage.js
  94. +21 −0 tests/FBTest/content/userMessage.xul
  95. +3 −0 tests/FBTest/defaults/preferences/prefs.js
  96. +6 −3 tests/content/console/completion/5493/issue5493.html
  97. +12 −5 tests/content/console/completion/5493/issue5493.js
  98. +5 −5 tests/content/cookies/18/issue18.js
  99. +1 −1 tests/content/cookies/18/issue18.php
  100. +4 −4 tests/content/cookies/23/issue23.js
  101. +1 −1 tests/content/cookies/23/issue23.php
  102. +3 −3 tests/content/cookies/25/issue25.js
  103. +4 −4 tests/content/cookies/25/issue25.php
  104. +3 −3 tests/content/cookies/34/issue34.js
  105. +2 −2 tests/content/cookies/34/issue34.php
  106. +3 −3 tests/content/cookies/39/issue39.js
  107. +1 −2 tests/content/cookies/39/issue39.php
  108. +3 −3 tests/content/cookies/44/issue44.js
  109. +2 −2 tests/content/cookies/44/issue44.php
  110. +3 −3 tests/content/cookies/45/issue45.js
  111. +1 −1 tests/content/cookies/45/issue45.php
  112. +3 −3 tests/content/cookies/54/issue54.js
  113. +1 −1 tests/content/cookies/54/issue54.php
  114. +3 −3 tests/content/cookies/60/issue60.js
  115. +1 −1 tests/content/cookies/60/issue60.php
  116. +6 −6 tests/content/cookies/general/{cookieBreakOnNext.js → breakOnNext.js}
  117. +1 −1 tests/content/cookies/general/breakOnNext.php
  118. +8 −8 tests/content/cookies/general/{cookieClipboard.js → clipboard.js}
  119. +37 −0 tests/content/cookies/general/clipboard.php
  120. +0 −26 tests/content/cookies/general/cookieClipboard.php
  121. +0 −29 tests/content/cookies/general/cookieEntry.js
  122. +0 −23 tests/content/cookies/general/cookieEntry.php
  123. +63 −0 tests/content/cookies/general/cookieInfo.js
  124. +57 −0 tests/content/cookies/general/cookieInfo.php
  125. +0 −21 tests/content/cookies/general/cookiePanel.js
  126. +0 −19 tests/content/cookies/general/cookiePanel.php
  127. +0 −55 tests/content/cookies/general/cookieValues.js
  128. +0 −44 tests/content/cookies/general/cookieValues.php
  129. +31 −0 tests/content/cookies/general/cookiesPanel.html
  130. +21 −0 tests/content/cookies/general/cookiesPanel.js
  131. +3 −3 tests/content/cookies/general/editCookies.js
  132. +1 −1 tests/content/css/3652/issue3652.js
  133. +2 −2 tests/content/css/3671/issue3671.js
  134. +11 −0 tests/content/dom/2558/issue2558.js
  135. +7 −7 tests/content/dom/4386/issue4386.js
  136. +5 −5 tests/content/firebug.html
  137. +22 −18 tests/content/html/5255/issue5255.js
  138. +35 −0 tests/content/script/breakpoints/5525/issue5525.html
  139. +37 −0 tests/content/script/breakpoints/5525/issue5525.js
  140. +11 −0 tests/content/script/callstack/1811/issue1811.js
  141. +12 −0 tests/content/script/callstack/3645/issue3645.js
  142. +1 −1 tests/templates/default/issueXXXX.html
  143. +1 −1 tests/templates/default/issueXXXXSeveralCases.html
  144. +1 −1 tests/templates/net/issueXXXX.html
View
@@ -22,9 +22,11 @@
/extension/release/
/tests/FBTest/release/
*.graphml
+/extension/bz-locale/
# Files from NPM
/extension/node_modules/
# Extensions
/extension/firebug@software.joehewitt.com
+
View
@@ -15,13 +15,15 @@ var FIREBUG_MODULES = [
"resource://firebug/firebug-http-observer.js",
"resource://firebug/firebug-service.js",
"resource://firebug/firebug-trace-service.js",
+ "resource://firebug/gcli.js",
"resource://firebug/loader.js",
"resource://firebug/locale.js",
+ "resource://firebug/mini-require.js",
"resource://firebug/observer-service.js",
+ "resource://firebug/prefLoader.js",
"resource://firebug/require-debug.js",
"resource://firebug/require.js",
- "resource://firebug/storageService.js",
- "resource://firebug/prefLoader.js"
+ "resource://firebug/storageService.js"
];
Cu.import("resource://gre/modules/Services.jsm");
@@ -68,6 +70,9 @@ function startup(params, reason)
// Listen for new windows, Firebug must be loaded into them too.
Services.ww.registerNotification(windowWatcher);
+
+ // GCLI commands
+ Cu.import("resource://firebug/gcli.js");
}
function shutdown(params, reason)
@@ -2,10 +2,10 @@ content firebug content/firebug/
content firebug content/firebug/ contentaccessible=yes
# Maps resource://firebug/* to files in modules/*
-resource firebug modules/
+# resource firebug modules/
# Maps resource://moduleloader/* to files in modules/*
-resource moduleloader modules/
+# resource moduleloader modules/
skin firebug classic/1.0 skin/classic/
skin firebug-os classic/1.0 skin/classic/win/
@@ -58,21 +58,24 @@ locale firebug sl-SI locale/sl-SI/
locale firebug sr locale/sr/
locale firebug sv-SE locale/sv-SE/
locale firebug te-IN locale/te-IN/
-locale firebug tr-TR locale/tr-TR/
+locale firebug tr locale/tr/
locale firebug uk-UA locale/uk-UA/
locale firebug vi locale/vi/
locale firebug zh-CN locale/zh-CN/
locale firebug zh-TW locale/zh-TW/
-overlay chrome://browser/content/browser.xul chrome://firebug/content/browserOverlay.xul
+#overlay chrome://browser/content/browser.xul chrome://firebug/content/browserOverlay.xul
#overlay chrome://browser/content/browser.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul
-overlay chrome://global/content/customizeToolbar.xul chrome://firebug/content/firefox/start-button/customizeToolbarOverlay.xul
-overlay chrome://mozapps/content/extensions/about.xul chrome://firebug/content/firefox/aboutOverlay.xul
-overlay chrome://navigator/content/navigator.xul chrome://firebug/content/browserOverlay.xul
+#overlay chrome://global/content/customizeToolbar.xul chrome://firebug/content/firefox/start-button/customizeToolbarOverlay.xul
+#overlay chrome://mozapps/content/extensions/about.xul chrome://firebug/content/firefox/aboutOverlay.xul
+
+# Sea Monkey
+#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/browserOverlay.xul
+#overlay chrome://navigator/content/navigator.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul
# Support for Mac
-override chrome://firebug/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
-override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
-override chrome://firebug-os/skin/panel.css chrome://firebug/skin/mac/panel.css os=Darwin
-override chrome://firebug-os/skin/window.css chrome://firebug/skin/mac/window.css os=Darwin
+override chrome://firebug/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
+override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
+override chrome://firebug-os/skin/panel.css chrome://firebug/skin/mac/panel.css os=Darwin
+override chrome://firebug-os/skin/window.css chrome://firebug/skin/mac/window.css os=Darwin
@@ -40,7 +40,7 @@ locale firebug sk-SK locale/sk-SK/
locale firebug sl-SI locale/sl-SI/
locale firebug sr locale/sr/
locale firebug sv-SE locale/sv-SE/
-locale firebug tr-TR locale/tr-TR/
+locale firebug tr locale/tr/
locale firebug uk-UA locale/uk-UA/
locale firebug vi locale/vi/
locale firebug zh-CN locale/zh-CN/
@@ -165,8 +165,16 @@ Firebug.Activation = Obj.extend(Firebug.Module,
// Firebug is opened in browser
watchBrowser: function(browser)
{
- var annotation = "firebugged.showFirebug";
- this.setPageAnnotation(browser.currentURI.spec, annotation);
+ try
+ {
+ var annotation = "firebugged.showFirebug";
+ this.setPageAnnotation(browser.currentURI.spec, annotation);
+ }
+ catch (e)
+ {
+ if (FBTrace.DBG_ERRORS)
+ FBTrace.sysout("activation.watchBrowser; EXCEPTION " + e, e);
+ }
},
// Firebug closes in browser
@@ -646,7 +646,9 @@ var FirebugChrome =
" sidePanelName:"+sidePanelName+" forceUpdate:"+forceUpdate+"\n");
var bestPanelName = getBestPanelName(object, Firebug.currentContext, panelName);
- var panel = this.selectPanel(bestPanelName, sidePanelName, true);
+
+ // Allow refresh if needed (the last argument).
+ var panel = this.selectPanel(bestPanelName, sidePanelName/*, true*/);
if (panel)
panel.select(object, forceUpdate);
@@ -208,6 +208,7 @@ Firebug.PanelActivation = Obj.extend(Firebug.Module,
panelType.prototype.onActivationChanged(enable);
+ Firebug.chrome.$("fbPanelBar1").updateTab(panelType);
Firebug.chrome.syncPanel();
},
@@ -3026,8 +3026,8 @@ FirebugReps.NamedNodeMap = domplate(Firebug.Rep,
for (var i=0; i<object.length && i<max; i++)
{
var item = object.item(i);
- var name = item.nodeName;
- var value = item.nodeValue;
+ var name = item.name;
+ var value = item.value;
var rep = Firebug.getRep(value);
var tag = rep.tag;
@@ -433,7 +433,7 @@ Firebug.TabWatcher = Obj.extend(new Firebug.Listener(),
/**
* Attaches to a window that may be either top-level or a frame within the page.
*/
- watchWindow: function(win, context)
+ watchWindow: function(win, context, skipCompletedDocuments)
{
if (!context)
context = this.getContextByWindow(Win.getRootWindow(win));
@@ -445,6 +445,21 @@ Firebug.TabWatcher = Obj.extend(new Firebug.Listener(),
if (context)
TabWatcherUnloader.registerWindow(win);
+ try
+ {
+ // If the documents is already completed do not register the window
+ // it should be registered already at this point
+ // This condition avoids situation when "about:document-onload-blocker"
+ // and STATE_START is fired for a window, which is consequently never
+ // firing "unload" and so, stays registered within context.windows
+ // See issue 5582 (comment #4)
+ if (skipCompletedDocuments && win.document.readyState == "complete")
+ return;
+ }
+ catch (err)
+ {
+ }
+
// Unfortunately, dummy requests that trigger the call to watchWindow
// are called several times, so we have to avoid dispatching watchWindow
// more than once
@@ -453,8 +468,11 @@ Firebug.TabWatcher = Obj.extend(new Firebug.Listener(),
context.windows.push(win);
if (FBTrace.DBG_WINDOWS)
- FBTrace.sysout("-> watchWindow register *** FRAME *** to context for " +
- "win.location: " + location);
+ {
+ FBTrace.sysout("-> tabWatcher.watchWindow; " + Win.safeGetWindowLocation(win) +
+ " [" + Win.getWindowId(win).toString() + "] " + context.windows.length +
+ " - " + win.document.readyState);
+ }
Events.dispatch(this.fbListeners, "watchWindow", [context, win]);
@@ -509,7 +527,7 @@ Firebug.TabWatcher = Obj.extend(new Firebug.Listener(),
{
if (FBTrace.DBG_ERRORS)
{
- FBTrace.sysout("unwatchWindow: no context for win " +
+ FBTrace.sysout("unwatchWindow: ERROR no context for win " +
Win.safeGetWindowLocation(win));
}
return;
@@ -518,8 +536,9 @@ Firebug.TabWatcher = Obj.extend(new Firebug.Listener(),
var index = context.windows.indexOf(win);
if (FBTrace.DBG_WINDOWS)
{
- FBTrace.sysout("-> tabWatcher.unwatchWindow context: " + context.getName() +
- " index of win: " + index + "/" + context.windows.length, context.windows);
+ FBTrace.sysout("-> tabWatcher.unwatchWindow; " + Win.safeGetWindowLocation(win) +
+ " [" + Win.getWindowId(win).toString() + "] " + context.windows.length +
+ " - " + win.document.readyState);
}
if (index != -1)
@@ -890,7 +909,7 @@ var FrameProgressListener = Obj.extend(Http.BaseProgressListener,
FBTrace.sysout("-> FrameProgressListener.onStateChanged for: " +
Http.safeGetRequestName(request) + ", win: " + win.location.href +
", content URL: " + (win.document ? win.document.URL : "no content URL") +
- " " + Http.getStateDescription(flag));
+ " " + Http.getStateDescription(flag) + ", " + status);
}
if (flag & STATE_IS_REQUEST && flag & STATE_START)
@@ -914,7 +933,7 @@ var FrameProgressListener = Obj.extend(Http.BaseProgressListener,
}
else
{
- Firebug.TabWatcher.watchWindow(win);
+ Firebug.TabWatcher.watchWindow(win, null, true);
}
}
}
@@ -180,6 +180,8 @@ Firebug.JSAutoCompleter = function(textBox, completionBox, options)
FBTrace.sysout("Completing: " + this.completionBase.pre + sep + preExpr + sep + prop);
}
+ var prevCompletions = this.completions;
+
// We only need to calculate a new candidate list if the expression has
// changed (we can ignore this.completionBase.pre since completions do not
// depend upon that).
@@ -188,17 +190,20 @@ Firebug.JSAutoCompleter = function(textBox, completionBox, options)
this.completionBase.expr = preExpr;
this.completionBase.candidates = autoCompleteEval(context, preExpr, spreExpr,
this.options.includeCurrentScope);
+ prevCompletions = null;
}
- this.createCompletions(prop);
+ this.createCompletions(prop, prevCompletions);
};
/**
* From a valid completion base, create a list of completions (containing
* those completion candidates that share a (sometimes case-insensitive)
- * prefix with the user's input) and a default completion.
+ * prefix with the user's input) and a default completion. The completions
+ * for the previous expression (null if none) are used to help with the
+ * latter.
*/
- this.createCompletions = function(prefix)
+ this.createCompletions = function(prefix, prevCompletions)
{
var candidates = this.completionBase.candidates;
var valid = [], ciValid = [];
@@ -247,7 +252,7 @@ Firebug.JSAutoCompleter = function(textBox, completionBox, options)
list: (hasMatchingCase ? valid : ciValid),
prefix: prefix
};
- this.pickDefaultCandidate();
+ this.completions.index = this.pickDefaultCandidate(prevCompletions);
if (hasMatchingCase)
{
@@ -266,20 +271,54 @@ Firebug.JSAutoCompleter = function(textBox, completionBox, options)
};
/**
- * Chose a default candidate from the list of completions. This is currently
- * selected as the shortest completion, to make completions disappear when
- * typing a variable name that is also the prefix of another.
+ * Choose a default candidate from the list of completions. The first of all
+ * shortest completions is current used for this, except in some very hacky,
+ * but useful, special cases (issue 5593).
*/
- this.pickDefaultCandidate = function()
+ this.pickDefaultCandidate = function(prevCompletions)
{
- var pick = 0;
- var ar = this.completions.list;
- for (var i = 1; i < ar.length; i++)
+ var list = this.completions.list, ind;
+
+ // If the typed expression is an extension of the previous completion, keep it.
+ if (prevCompletions && Str.hasPrefix(this.completions.prefix, prevCompletions.prefix))
+ {
+ var lastCompletion = prevCompletions.list[prevCompletions.index];
+ ind = list.indexOf(lastCompletion);
+ if (ind !== -1)
+ return ind;
+ }
+
+ // Special-case certain expressions.
+ var special = {
+ "": ["document", "console", "window", "parseInt", "undefined"],
+ "window.": ["console"],
+ "location.": ["href"],
+ "document.": ["getElementById", "addEventListener", "createElement",
+ "documentElement"]
+ };
+ if (special.hasOwnProperty(this.completionBase.expr))
+ {
+ var ar = special[this.completionBase.expr];
+ for (var i = 0; i < ar.length; ++i)
+ {
+ var prop = ar[i];
+ if (Str.hasPrefix(prop, this.completions.prefix))
+ {
+ // Use 'prop' as a completion, if it exists.
+ ind = list.indexOf(prop);
+ if (ind !== -1)
+ return ind;
+ }
+ }
+ }
+
+ ind = 0;
+ for (var i = 1; i < list.length; ++i)
{
- if (ar[i].length < ar[pick].length)
- pick = i;
+ if (list[i].length < list[ind].length)
+ ind = i;
}
- this.completions.index = pick;
+ return ind;
};
/**
@@ -389,7 +389,7 @@ Firebug.Console = Obj.extend(ActivableConsole,
setStatus: function()
{
- var fbStatus = Firefox.getElementById('firebugStatus');
+ var fbStatus = Firefox.getElementById("firebugStatus");
if (fbStatus)
{
if (Firebug.Errors.watchForErrors)
@@ -298,6 +298,9 @@ Firebug.ConsolePanel.prototype = Obj.extend(Firebug.ActivablePanel,
setFilter: function(filterTypes)
{
var panelNode = this.panelNode;
+
+ Events.dispatch(this.fbListeners, "onFilterSet", [logTypes]);
+
for (var type in logTypes)
{
// Different types of errors and warnings are combined for filtering
Oops, something went wrong.

1 comment on commit 9796f0c

@SebastianZ

This comment has been minimized.

Show comment
Hide comment
@SebastianZ

SebastianZ Jun 21, 2012

Member

Please avoid such inexpressive comments in the future.

Besides that thanks for the great work!

Sebastian

Member

SebastianZ commented on 9796f0c Jun 21, 2012

Please avoid such inexpressive comments in the future.

Besides that thanks for the great work!

Sebastian

Please sign in to comment.