Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'codemirror' of https://github.com/firebug/firebug into …

…codemirror
  • Loading branch information...
commit 8fe9f00a340c1a967ef26a1c6b2ea7050707eb38 2 parents 176e8cf + 35ed6c5
Farshid Beheshti FarshidBeheshti authored

Showing 117 changed files with 3,030 additions and 938 deletions. Show diff stats Hide diff stats

  1. +4 4 extension/chrome.manifest
  2. +1 1  extension/content/firebug/branch.properties
  3. +23 11 extension/content/firebug/chrome/chrome.js
  4. +8 3 extension/content/firebug/chrome/menu.js
  5. +18 4 extension/content/firebug/chrome/panelActivation.js
  6. +19 62 extension/content/firebug/chrome/reps.js
  7. +1 1  extension/content/firebug/console/commandLineExposed.js
  8. +22 6 extension/content/firebug/console/commandLineInclude.js
  9. +1 0  extension/content/firebug/console/console.js
  10. +209 49 extension/content/firebug/console/eventMonitor.js
  11. +1 1  extension/content/firebug/cookies/cookieReps.js
  12. +26 6 extension/content/firebug/css/computedPanel.js
  13. +281 17 extension/content/firebug/css/cssPanel.js
  14. +1 1  extension/content/firebug/css/selectorModule.js
  15. +3 3 extension/content/firebug/css/stylePanel.js
  16. +1 1  extension/content/firebug/debugger/script/breakNotification.js
  17. +3 0  extension/content/firebug/editor/editor.js
  18. +11 9 extension/content/firebug/firebug.css
  19. +0 2  extension/content/firebug/firebugOverlay.xul
  20. +1 1  extension/content/firebug/firefox/bindings.xml
  21. +114 41 extension/content/firebug/lib/css.js
  22. +11 2 extension/content/firebug/lib/events.js
  23. +1 1  extension/install.rdf
  24. +1 0  extension/locale/en-US/cookies.properties
  25. +5 0 extension/locale/en-US/firebug.properties
  26. +20 3 extension/modules/storageService.js
  27. +1 2  extension/skin/classic/breakOn.svg
  28. +1 2  extension/skin/classic/breakOn/breakOnError.svg
  29. +1 2  extension/skin/classic/breakOn/breakOnMutate.svg
  30. +1 2  extension/skin/classic/breakOn/breakOnNext.svg
  31. +1 2  extension/skin/classic/breakOn/breakOnXHR.svg
  32. +4 3 extension/skin/classic/breakOnArmed.svg
  33. +0 4 extension/skin/classic/breakpoint.css
  34. +7 9 extension/skin/classic/breakpointCondition.svg
  35. BIN  extension/skin/classic/condBorders.png
  36. BIN  extension/skin/classic/condBordersUps.png
  37. BIN  extension/skin/classic/condCorners.png
  38. BIN  extension/skin/classic/condCornersUps.png
  39. BIN  extension/skin/classic/console-error-caret.png
  40. +2 2 extension/skin/classic/console.css
  41. +1 2  extension/skin/classic/cookies/breakOnCookie.svg
  42. +4 4 extension/skin/classic/css.css
  43. +2 23 extension/skin/classic/debugger.css
  44. +35 0 extension/skin/classic/errorColumnIndicator.svg
  45. +480 533 extension/skin/classic/firebug.css
  46. +2 1  extension/skin/classic/html.css
  47. +39 0 extension/skin/classic/mac/breakpointConditionEditor.svg
  48. +39 0 extension/skin/classic/mac/breakpointConditionEditorDown.svg
  49. +12 18 extension/skin/classic/mac/debugger.css
  50. +2 2 extension/skin/classic/mac/firebug.css
  51. +37 0 extension/skin/classic/mac/optionsMenuTarget.svg
  52. +40 0 extension/skin/classic/mac/optionsMenuTargetHover.svg
  53. +5 13 extension/skin/classic/mac/panel.css
  54. BIN  extension/skin/classic/mac/search-panel-down.png
  55. BIN  extension/skin/classic/mac/search-panel.png
  56. +39 0 extension/skin/classic/mac/searchPanel.svg
  57. +40 0 extension/skin/classic/mac/searchPanelDown.svg
  58. BIN  extension/skin/classic/mac/twistyClosed.png
  59. +36 0 extension/skin/classic/mac/twistyClosed.svg
  60. BIN  extension/skin/classic/mac/twistyOpen.png
  61. +36 0 extension/skin/classic/mac/twistyOpen.svg
  62. BIN  extension/skin/classic/tabMenuTarget.png
  63. BIN  extension/skin/classic/tabMenuTargetHover.png
  64. +94 0 extension/skin/classic/win/breakpointConditionEditor.svg
  65. +220 0 extension/skin/classic/win/breakpointConditionEditorDown.svg
  66. +33 0 extension/skin/classic/win/debugger.css
  67. +36 0 extension/skin/classic/win/optionsMenuTarget.svg
  68. +38 0 extension/skin/classic/win/optionsMenuTargetHover.svg
  69. +3 7 extension/skin/classic/win/panel.css
  70. BIN  extension/skin/classic/win/tabMenuTarget.png
  71. BIN  extension/skin/classic/win/tabMenuTargetHover.png
  72. BIN  extension/skin/classic/win/twistyClosed.png
  73. +80 0 extension/skin/classic/win/twistyClosed.svg
  74. BIN  extension/skin/classic/win/twistyOpen.png
  75. +83 0 extension/skin/classic/win/twistyOpen.svg
  76. +13 13 tests/FBTest/content/FBTestFirebug.js
  77. +5 2 tests/FBTest/defaults/preferences/prefs.js
  78. +1 1  tests/FBTest/skin/classic/tabView.css
  79. +4 4 tests/FBTest/skin/classic/testList.css
  80. +3 3 tests/FBTest/skin/classic/testResult.css
  81. BIN  tests/FBTest/skin/classic/twistyClosed.png
  82. +80 0 tests/FBTest/skin/classic/twistyClosed.svg
  83. BIN  tests/FBTest/skin/classic/twistyOpen.png
  84. +83 0 tests/FBTest/skin/classic/twistyOpen.svg
  85. +1 1  tests/content/_common/tabView.css
  86. +4 4 tests/content/_common/testList.css
  87. +3 3 tests/content/_common/testResult.css
  88. +80 0 tests/content/_common/twistyClosed.svg
  89. +83 0 tests/content/_common/twistyOpen.svg
  90. +4 1 tests/content/commandLine/6291/issue6291.html
  91. +16 15 tests/content/commandLine/6291/issue6291.js
  92. +1 1  tests/content/console/3042/issue3042.js
  93. +4 3 tests/content/console/5945/issue5945.js
  94. +17 1 tests/content/css/2976/issue2976.js
  95. +4 1 tests/content/css/4411/issue4411.js
  96. +5 1 tests/content/css/4460/issue4460.js
  97. +9 5 tests/content/css/5644/issue5644.js
  98. +42 0 tests/content/css/6405/issue6405.html
  99. +68 0 tests/content/css/6405/issue6405.js
  100. +2 2 tests/content/css/computed/5449/issue5449.js
  101. +2 1  tests/content/firebug.html
  102. +1 1  tests/content/net/654/issue654.js
  103. +6 1 tests/content/search/4602/issue4602.js
  104. +2 2 trace/FBTrace/chrome/skin/classic/console.css
  105. +2 2 trace/FBTrace/chrome/skin/classic/mac/panel.css
  106. +2 2 trace/FBTrace/chrome/skin/classic/mac/traceConsole.css
  107. BIN  trace/FBTrace/chrome/skin/classic/mac/twistyClosed.png
  108. +36 0 trace/FBTrace/chrome/skin/classic/mac/twistyClosed.svg
  109. BIN  trace/FBTrace/chrome/skin/classic/mac/twistyOpen.png
  110. +36 0 trace/FBTrace/chrome/skin/classic/mac/twistyOpen.svg
  111. +4 4 trace/FBTrace/chrome/skin/classic/traceConsole.css
  112. +2 2 trace/FBTrace/chrome/skin/classic/win/panel.css
  113. +2 2 trace/FBTrace/chrome/skin/classic/win/traceConsole.css
  114. BIN  trace/FBTrace/chrome/skin/classic/win/twistyClosed.png
  115. +80 0 trace/FBTrace/chrome/skin/classic/win/twistyClosed.svg
  116. BIN  trace/FBTrace/chrome/skin/classic/win/twistyOpen.png
  117. +83 0 trace/FBTrace/chrome/skin/classic/win/twistyOpen.svg
8 extension/chrome.manifest
@@ -48,10 +48,10 @@ locale firebug zh-CN locale/zh-CN/
48 48 locale firebug zh-TW locale/zh-TW/
49 49
50 50 # Support for Mac
51   -override chrome://firebug/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
52   -override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
53   -override chrome://firebug-os/skin/panel.css chrome://firebug/skin/mac/panel.css os=Darwin
54   -override chrome://firebug-os/skin/window.css chrome://firebug/skin/mac/window.css os=Darwin
  51 +override chrome://firebug-os/skin/debugger.css chrome://firebug/skin/mac/debugger.css os=Darwin
  52 +override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/mac/firebug.css os=Darwin
  53 +override chrome://firebug-os/skin/panel.css chrome://firebug/skin/mac/panel.css os=Darwin
  54 +override chrome://firebug-os/skin/window.css chrome://firebug/skin/mac/window.css os=Darwin
55 55
56 56 # Support for Linux
57 57 override chrome://firebug-os/skin/firebug.css chrome://firebug/skin/linux/firebug.css os=Linux
2  extension/content/firebug/branch.properties
... ... @@ -1,5 +1,5 @@
1 1 # DO NOT MERGE INTO TRUNK
2   -RELEASE=.0a4
  2 +RELEASE=.0a5
3 3 VERSION=1.12
4 4 TRUNK=
5 5 # To allow build.xml to drop the xpi directly into the svn working copy for getfirebug.com
34 extension/content/firebug/chrome/chrome.js
@@ -2094,32 +2094,44 @@ function onPanelMouseUp(event)
2094 2094 {
2095 2095 var selection = event.target.ownerDocument.defaultView.getSelection();
2096 2096 var target = selection.focusNode || event.target;
2097   - if (selection.focusNode === selection.anchorNode)
  2097 +
  2098 + if (Dom.getAncestorByClass(selection.focusNode, "editable") ===
  2099 + Dom.getAncestorByClass(selection.anchorNode, "editable"))
2098 2100 {
2099 2101 var editable = Dom.getAncestorByClass(target, "editable");
2100 2102 if (editable || Css.hasClass(event.target, "inlineExpander"))
2101 2103 {
2102 2104 var selectionData;
2103   - var selFO = selection.focusOffset,selAO = selection.anchorOffset;
  2105 + var unselectedRange = event.target.ownerDocument.createRange();
  2106 + var selectedRange = selection.getRangeAt(0);
  2107 + unselectedRange.setStart(editable.firstElementChild || editable, 0);
  2108 + unselectedRange.setEnd(selectedRange.startContainer, selectedRange.startOffset);
2104 2109
2105   - // selection is collapsed
2106   - if (selFO == selAO)
  2110 + if (selectedRange.collapsed)
2107 2111 {
2108 2112 var distance = Math.abs(event.screenX - this.lastMouseDownPosition.x) +
2109 2113 Math.abs(event.screenY - this.lastMouseDownPosition.y);
2110 2114
2111 2115 // If mouse has moved far enough, set selection at that point
2112 2116 if (distance > 3)
2113   - selectionData = {start: selFO, end: selFO};
  2117 + {
  2118 + selectionData =
  2119 + {
  2120 + start: selectedRange.startOffset,
  2121 + end: selectedRange.endOffset
  2122 + };
  2123 + }
2114 2124 // otherwise leave selectionData undefined to select all text
2115 2125 }
2116   - else if (selFO < selAO)
2117   - {
2118   - selectionData = {start: selFO, end: selAO};
2119   - }
2120 2126 else
2121 2127 {
2122   - selectionData = {start: selAO, end: selFO};
  2128 + var unselectedRangeLength = unselectedRange.toString().length;
  2129 + var selectedRangeLength = selection.getRangeAt(0).toString().length;
  2130 + selectionData =
  2131 + {
  2132 + start: unselectedRangeLength,
  2133 + end: unselectedRangeLength + selectedRangeLength
  2134 + };
2123 2135 }
2124 2136
2125 2137 if (editable)
@@ -2128,7 +2140,7 @@ function onPanelMouseUp(event)
2128 2140 }
2129 2141 else
2130 2142 {
2131   - Firebug.Editor.setSelection(selectionData || {start: selFO, end: selFO});
  2143 + Firebug.Editor.setSelection(selectionData);
2132 2144 selection.removeAllRanges();
2133 2145 }
2134 2146
11 extension/content/firebug/chrome/menu.js
@@ -95,9 +95,6 @@ Menu.setItemIntoElement = function(element, item)
95 95 if (item.type == "checkbox" && !item.closemenu)
96 96 element.setAttribute("closemenu", "none");
97 97
98   - if (item.checked)
99   - element.setAttribute("checked", "true");
100   -
101 98 if (item.disabled)
102 99 element.setAttribute("disabled", "true");
103 100
@@ -134,7 +131,15 @@ Menu.setItemIntoElement = function(element, item)
134 131 element.setAttribute("name", item.name);
135 132
136 133 if (item.items && (item.command || item.commandID))
  134 + {
137 135 element.setAttribute("type", "splitmenu");
  136 + element.setAttribute("iconic", "true");
  137 + }
  138 +
  139 + // xxxHonza: must be done after 'type' == 'splitmenu' otherwise the menu-item
  140 + // is not checked (the check icon is not displayed from some reason).
  141 + if (item.checked)
  142 + element.setAttribute("checked", "true");
138 143
139 144 return element;
140 145 };
22 extension/content/firebug/chrome/panelActivation.js
@@ -6,10 +6,11 @@ define([
6 6 "firebug/chrome/firefox",
7 7 "firebug/lib/locale",
8 8 "firebug/lib/domplate",
  9 + "firebug/lib/xpcom",
9 10 "firebug/lib/url",
10   - "firebug/lib/dom",
  11 + "firebug/lib/dom"
11 12 ],
12   -function(Obj, Firebug, Firefox, Locale, Domplate, Url, Dom) {
  13 +function(Obj, Firebug, Firefox, Locale, Domplate, Xpcom, Url, Dom) {
13 14
14 15 // ************************************************************************************************
15 16 // Constants
@@ -18,7 +19,7 @@ const Cc = Components.classes;
18 19 const Ci = Components.interfaces;
19 20
20 21 const prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
21   -
  22 +const prompts = Xpcom.CCSV("@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService");
22 23
23 24 /**
24 25 * @module Implements Panel activation logic. A Firebug panel can support activation in order
@@ -223,8 +224,21 @@ Firebug.PanelActivation = Obj.extend(Firebug.Module,
223 224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 225 // UI commands
225 226
226   - clearAnnotations: function()
  227 + clearAnnotations: function(force)
227 228 {
  229 + if (!force)
  230 + {
  231 + var check = {value: false};
  232 + var flags = prompts.BUTTON_POS_0 * prompts.BUTTON_TITLE_YES +
  233 + prompts.BUTTON_POS_1 * prompts.BUTTON_TITLE_NO;
  234 +
  235 + if (!prompts.confirmEx(Firebug.chrome.window, Locale.$STR("Firebug"),
  236 + Locale.$STR("annotations.confirm.clear"), flags, "", "", "", null, check) == 0)
  237 + {
  238 + return;
  239 + }
  240 + }
  241 +
228 242 Firebug.connection.clearAnnotations();
229 243 },
230 244
81 extension/content/firebug/chrome/reps.js
@@ -25,7 +25,6 @@ define([
25 25 "firebug/lib/string",
26 26 "firebug/lib/xml",
27 27 "firebug/dom/toggleBranch",
28   - "firebug/console/eventMonitor",
29 28 "firebug/console/closureInspector",
30 29 "firebug/chrome/menu",
31 30 "arch/compilationunit",
@@ -1485,23 +1484,10 @@ FirebugReps.Element = domplate(Firebug.Rep,
1485 1484 }
1486 1485 ]);
1487 1486 }
1488   -
  1487 +
1489 1488 items = items.concat([
1490 1489 "-",
1491 1490 {
1492   - label: "ShowEventsInConsole",
1493   - tooltiptext: "html.tip.Show_Events_In_Console",
1494   - id: "fbShowEventsInConsole",
1495   - type: "checkbox",
1496   - checked: EventMonitor.areEventsMonitored(elt, null, context),
1497   - command: function()
1498   - {
1499   - var checked = this.hasAttribute("checked");
1500   - EventMonitor.toggleMonitorEvents(elt, null, !checked, context);
1501   - }
1502   - },
1503   - "-",
1504   - {
1505 1491 label: "ScrollIntoView",
1506 1492 tooltiptext: "html.tip.Scroll_Into_View",
1507 1493 id: "fbScrollIntoView",
@@ -1734,6 +1720,15 @@ FirebugReps.CSSRule = domplate(Firebug.Rep,
1734 1720 {
1735 1721 return "CSSStyleRule";
1736 1722 }
  1723 + else if (window.CSSSupportsRule && rule instanceof window.CSSSupportsRule)
  1724 + {
  1725 + return "CSSSupportsRule";
  1726 + }
  1727 + else if ((window.CSSDocumentRule && rule instanceof window.CSSDocumentRule) ||
  1728 + rule instanceof window.CSSMozDocumentRule)
  1729 + {
  1730 + return "CSSDocumentRule";
  1731 + }
1737 1732 else if (rule instanceof window.CSSFontFaceRule)
1738 1733 {
1739 1734 return "CSSFontFaceRule";
@@ -1778,6 +1773,15 @@ FirebugReps.CSSRule = domplate(Firebug.Rep,
1778 1773 {
1779 1774 return rule.selectorText;
1780 1775 }
  1776 + else if (window.CSSSupportsRule && rule instanceof window.CSSSupportsRule)
  1777 + {
  1778 + return rule.conditionText;
  1779 + }
  1780 + else if ((window.CSSDocumentRule && rule instanceof window.CSSDocumentRule) ||
  1781 + rule instanceof window.CSSMozDocumentRule)
  1782 + {
  1783 + return rule.conditionText;
  1784 + }
1781 1785 else if (rule instanceof window.CSSFontFaceRule)
1782 1786 {
1783 1787 return rule.style.getPropertyValue("font-family");
@@ -1962,52 +1966,6 @@ FirebugReps.Event = domplate(Firebug.Rep,
1962 1966
1963 1967 // ********************************************************************************************* //
1964 1968
1965   -FirebugReps.EventLog = domplate(FirebugReps.Event,
1966   -{
1967   - className: "eventLog",
1968   -
1969   - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1970   -
1971   - tag:
1972   - TAG("$copyEventTag", {object: "$object|copyEvent"}),
1973   -
1974   - copyEventTag:
1975   - SPAN(
1976   - OBJECTLINK("$object|summarizeEvent"),
1977   - SPAN("&nbsp"),
1978   - SPAN("&#187;"),
1979   - SPAN("&nbsp"),
1980   - TAG("$object|getTargetTag", {object: "$object|getTarget"})
1981   - ),
1982   -
1983   - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1984   -
1985   - copyEvent: function(log)
1986   - {
1987   - return new Dom.EventCopy(log.event);
1988   - },
1989   -
1990   - getTarget: function(event)
1991   - {
1992   - return event.target;
1993   - },
1994   -
1995   - getTargetTag: function(event)
1996   - {
1997   - var rep = Firebug.getRep(event.target);
1998   - return rep.shortTag ? rep.shortTag : rep.tag;
1999   - },
2000   -
2001   - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
2002   -
2003   - supportsObject: function(object, type)
2004   - {
2005   - return object instanceof EventMonitor.EventLog;
2006   - },
2007   -});
2008   -
2009   -// ********************************************************************************************* //
2010   -
2011 1969 FirebugReps.SourceLink = domplate(Firebug.Rep,
2012 1970 {
2013 1971 tag:
@@ -2800,7 +2758,6 @@ Firebug.registerRep(
2800 2758 FirebugReps.Date,
2801 2759 FirebugReps.NamedNodeMap,
2802 2760 FirebugReps.Reference,
2803   - FirebugReps.EventLog,
2804 2761 FirebugReps.ClosureScope,
2805 2762 FirebugReps.OptimizedAway
2806 2763 );
2  extension/content/firebug/console/commandLineExposed.js
@@ -314,7 +314,7 @@ function evaluate(context, win, expr, origExpr, onSuccess, onError)
314 314 {
315 315 // Change source and line number of exceptions from commandline code
316 316 // create new error since properties of nsIXPCException are not modifiable.
317   - // Example of code raising nsIXPCException: `alert()` (without arguments)
  317 + // Example of code raising nsIXPCException: `alert({toString: function(){ throw "blah"; }})`
318 318
319 319 // xxxFlorent: FIXME: we can't get the right stack trace with this example:
320 320 // function a(){
28 extension/content/firebug/console/commandLineInclude.js
@@ -25,6 +25,7 @@ const Ci = Components.interfaces;
25 25 const Cu = Components.utils;
26 26 const removeConfirmation = "commandline.include.removeConfirmation";
27 27 const prompts = Xpcom.CCSV("@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService");
  28 +const storeFilename = "includeAliases.json";
28 29
29 30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 31
@@ -41,8 +42,13 @@ catch(ex)
41 42 // Scratchpad does not exists (when using Seamonkey ...)
42 43 }
43 44
44   -var storageScope = {};
  45 +var storageScope = {}, StorageService;
45 46 Cu.import("resource://firebug/storageService.js", storageScope);
  47 +StorageService = storageScope.StorageService;
  48 +
  49 +var defaultAliases = {
  50 + "jquery": "http://code.jquery.com/jquery-latest.js"
  51 +};
46 52
47 53 // ********************************************************************************************* //
48 54 // Implementation
@@ -340,14 +346,22 @@ var CommandLineInclude = Obj.extend(Firebug.Module,
340 346 {
341 347 if (!this.store)
342 348 {
  349 + var isNewStore = !StorageService.hasStorage(storeFilename);
343 350 // Pass also the parent window to the new storage. The window will be
344 351 // used to figure out whether the browser is running in private mode.
345 352 // If yes, no data will be persisted.
346   - this.store = storageScope.StorageService.getStorage("includeAliases.json",
  353 + this.store = StorageService.getStorage(storeFilename,
347 354 Firebug.chrome.window);
  355 +
  356 + // If the file did not exist, we put in there the default aliases.
  357 + if (isNewStore)
  358 + {
  359 + for (var alias in defaultAliases)
  360 + this.store.setItem(alias, defaultAliases[alias]);
  361 + }
348 362 }
349 363
350   - // let's log when the store could not be opened:
  364 + // Let's log when the store could not be opened.
351 365 if (!this.store)
352 366 {
353 367 if (FBTrace.DBG_COMMANDLINE)
@@ -499,9 +513,11 @@ var CommandLineInclude = Obj.extend(Firebug.Module,
499 513
500 514 resetAllOptions: function()
501 515 {
502   - var store = this.getStore();
503   - if (store)
504   - store.clear(true);
  516 + if (StorageService.hasStorage(storeFilename))
  517 + {
  518 + StorageService.removeStorage(storeFilename);
  519 + this.store = null;
  520 + }
505 521 }
506 522 });
507 523
1  extension/content/firebug/console/console.js
@@ -14,6 +14,7 @@ define([
14 14 "firebug/console/consolePanel",
15 15 "firebug/console/commandEditor",
16 16 "firebug/console/functionMonitor",
  17 + "firebug/console/eventMonitor",
17 18 "firebug/console/performanceTiming",
18 19 ],
19 20 function(Obj, Firebug, Firefox, Events, Win, Search, Xml, Options) {
258 extension/content/firebug/console/eventMonitor.js
@@ -6,8 +6,12 @@ define([
6 6 "firebug/lib/trace",
7 7 "firebug/lib/events",
8 8 "firebug/lib/locale",
  9 + "firebug/lib/dom",
  10 + "firebug/lib/domplate",
  11 + "firebug/chrome/reps",
  12 + "firebug/chrome/menu",
9 13 ],
10   -function(Obj, Firebug, FBTrace, Events, Locale) {
  14 +function(Obj, Firebug, FBTrace, Events, Locale, Dom, Domplate, FirebugReps, Menu) {
11 15
12 16 // ********************************************************************************************* //
13 17 // EventMonitor Module
@@ -19,15 +23,27 @@ var EventMonitor = Obj.extend(Firebug.Module,
19 23 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
20 24 // Module
21 25
  26 + initialize: function()
  27 + {
  28 + Firebug.Module.initialize.apply(this, arguments);
  29 + Firebug.registerUIListener(this);
  30 + },
  31 +
  32 + shutdown: function()
  33 + {
  34 + Firebug.unregisterUIListener(this);
  35 + Firebug.Module.shutdown.apply(this, arguments);
  36 + },
  37 +
22 38 destroyContext: function(context, persistedState)
23 39 {
24 40 // Clean up all existing monitors.
25   - var eventsMonitored = context.eventsMonitored;
26   - if (eventsMonitored)
  41 + var monitoredEvents = context.monitoredEvents;
  42 + if (monitoredEvents)
27 43 {
28   - for (var i=0; i<eventsMonitored.length; ++i)
  44 + for (var i=0; i<monitoredEvents.length; ++i)
29 45 {
30   - var m = eventsMonitored[i];
  46 + var m = monitoredEvents[i];
31 47
32 48 if (!m.type)
33 49 Events.detachAllListeners(m.object, context.onMonitorEvent, context);
@@ -40,12 +56,12 @@ var EventMonitor = Obj.extend(Firebug.Module,
40 56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 57 // Event Monitor
42 58
43   - toggleMonitorEvents: function(object, types, state, context)
  59 + toggleMonitorEvents: function(object, types, monitor, context)
44 60 {
45   - if (state)
46   - this.unmonitorEvents(object, types, context);
47   - else
  61 + if (monitor)
48 62 this.monitorEvents(object, types, context);
  63 + else
  64 + this.unmonitorEvents(object, types, context);
49 65 },
50 66
51 67 monitorEvents: function(object, types, context)
@@ -60,20 +76,25 @@ var EventMonitor = Obj.extend(Firebug.Module,
60 76 };
61 77 }
62 78
63   - if (!context.eventsMonitored)
64   - context.eventsMonitored = [];
  79 + if (!context.monitoredEvents)
  80 + context.monitoredEvents = new Map();
65 81
  82 + var monitoredEvents = context.monitoredEvents;
66 83 var eventTypes = getMonitoredEventTypes(types);
67 84
68 85 if (FBTrace.DBG_EVENTS)
69 86 FBTrace.sysout("EventMonitor.monitorEvents", eventTypes);
70 87
71   - for (var i = 0; i < eventTypes.length; ++i)
  88 + if (!context.monitoredEvents.has(object))
  89 + context.monitoredEvents.set(object, new Set());
  90 +
  91 + var monitoredEventTypes = monitoredEvents.get(object);
  92 + for (var i = 0, len = eventTypes.length; i < len; ++i)
72 93 {
73 94 if (!this.areEventsMonitored(object, eventTypes[i], context))
74 95 {
75 96 Events.addEventListener(object, eventTypes[i], context.onMonitorEvent, false);
76   - context.eventsMonitored.push({object: object, type: eventTypes[i]});
  97 + monitoredEventTypes.add(eventTypes[i]);
77 98 }
78 99 }
79 100 }
@@ -81,31 +102,38 @@ var EventMonitor = Obj.extend(Firebug.Module,
81 102
82 103 unmonitorEvents: function(object, types, context)
83 104 {
84   - var eventsMonitored = context.eventsMonitored;
  105 + var monitoredEvents = context.monitoredEvents;
  106 +
  107 + if (!monitoredEvents)
  108 + return;
  109 +
85 110 var eventTypes = getMonitoredEventTypes(types);
86 111
87 112 if (FBTrace.DBG_EVENTS)
88 113 FBTrace.sysout("EventMonitor.unmonitorEvents", eventTypes);
89 114
90   - for (var i = 0; i < eventTypes.length; ++i)
  115 + if (object)
91 116 {
92   - for (var j = 0; j < eventsMonitored.length; ++j)
  117 + if (monitoredEvents.has(object))
93 118 {
94   - if (eventsMonitored[j].object == object && eventsMonitored[j].type == eventTypes[i])
  119 + var monitoredObjectEvents = monitoredEvents.get(object);
  120 + for (var i = 0, len = eventTypes.length; i < len; ++i)
95 121 {
96   - eventsMonitored.splice(j, 1);
97   -
98   - Events.removeEventListener(object, eventTypes[i], context.onMonitorEvent, false);
99   - break;
  122 + if (monitoredObjectEvents.has(eventTypes[i]))
  123 + {
  124 + Events.removeEventListener(object, eventTypes[i],
  125 + context.onMonitorEvent, false);
  126 + monitoredObjectEvents["delete"](eventTypes[i]);
  127 + }
100 128 }
101 129 }
102 130 }
103 131 },
104 132
105   - areEventsMonitored: function(object, types, context)
  133 + areEventsMonitored: function(object, types, context, allMonitored)
106 134 {
107   - var eventsMonitored = context.eventsMonitored;
108   - if (!eventsMonitored)
  135 + var monitoredEvents = context.monitoredEvents;
  136 + if (!monitoredEvents)
109 137 {
110 138 if (FBTrace.DBG_EVENTS)
111 139 FBTrace.sysout("EventMonitor.areEventsMonitored - No events monitored", object);
@@ -113,23 +141,17 @@ var EventMonitor = Obj.extend(Firebug.Module,
113 141 return false;
114 142 }
115 143
116   - var eventTypes = [];
117   - if (!types)
118   - eventTypes = Events.getEventTypes();
119   - else
120   - eventTypes = typeof types == "string" ? [types] : types;
  144 + var eventTypes = getMonitoredEventTypes(types);
  145 + var monitoredObjectEvents = monitoredEvents.get(object);
  146 + if (!monitoredObjectEvents)
  147 + return;
  148 +
  149 + if (typeof allMonitored == "undefined")
  150 + allMonitored = true;
121 151
122   - for (var i = 0; i < eventTypes.length; ++i)
  152 + for (var i = 0, len = eventTypes.length; i < len; ++i)
123 153 {
124   - var monitored = false;
125   - for (var j = 0; j < eventsMonitored.length; ++j)
126   - {
127   - if (eventsMonitored[j].object == object && eventsMonitored[j].type == eventTypes[i])
128   - {
129   - monitored = true;
130   - break;
131   - }
132   - }
  154 + var monitored = monitoredObjectEvents.has(eventTypes[i]);
133 155
134 156 if (!monitored)
135 157 {
@@ -139,7 +161,8 @@ var EventMonitor = Obj.extend(Firebug.Module,
139 161 eventTypes[i] + "'");
140 162 }
141 163
142   - return false;
  164 + if (allMonitored)
  165 + return false;
143 166 }
144 167 else
145 168 {
@@ -148,10 +171,13 @@ var EventMonitor = Obj.extend(Firebug.Module,
148 171 FBTrace.sysout("EventMonitor.areEventsMonitored - Events monitored for '" +
149 172 eventTypes[i] + "'");
150 173 }
  174 +
  175 + if (!allMonitored)
  176 + return true;
151 177 }
152 178 }
153 179
154   - return true;
  180 + return allMonitored;
155 181 },
156 182
157 183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -159,17 +185,94 @@ var EventMonitor = Obj.extend(Firebug.Module,
159 185
160 186 onMonitorEvent: function(event, context)
161 187 {
162   - var obj = new EventMonitor.EventLog(event);
  188 + var obj = new EventLog(event);
163 189 Firebug.Console.log(obj, context);
164   - }
165   -});
  190 + },
166 191
167   -// ********************************************************************************************* //
  192 + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  193 + // UI Listener
168 194
169   -EventMonitor.EventLog = function(event)
170   -{
171   - this.event = event;
172   -};
  195 + onContextMenu: function(items, object, target, context, panel, popup)
  196 + {
  197 + if (panel.name != "html")
  198 + return items;
  199 +
  200 + var before = popup.querySelector("#fbScrollIntoView");
  201 + if (!before)
  202 + return items;
  203 +
  204 + var elt = object;
  205 +
  206 + // Create sub-menu-items for "Log Event"
  207 + var logEventItems = [];
  208 + var eventFamilies = Events.getEventFamilies();
  209 + for (var i=0, count=eventFamilies.length; i<count; ++i)
  210 + {
  211 + var family = eventFamilies[i];
  212 +
  213 + // Compose a tooltip for the menu item.
  214 + var tooltipText = "Monitor " + eventFamilies[i] + " events:";
  215 + var types = Events.getEventTypes(family);
  216 + tooltipText += "\n" + types.join(", ");
  217 +
  218 + // xxxHonza: there could be a helper for getting the CSS selector
  219 + var Element = FirebugReps.Element;
  220 + var selector = Element.getSelectorTag(elt) +
  221 + Element.getSelectorId(elt) +
  222 + Element.getSelectorClass(elt);
  223 +
  224 + // xxxHonza: localization?
  225 + tooltipText += "\n\nCommand Line Example:\n" +
  226 + "monitorEvents($('" + selector + "'), '" + family + "')";
  227 +
  228 + logEventItems.push({
  229 + nol10n: true,
  230 + label: Locale.$STR(family),
  231 + tooltiptext: tooltipText,
  232 + id: "monitor" + family + "Events",
  233 + type: "checkbox",
  234 + checked: this.areEventsMonitored(elt, family, context),
  235 + command: Obj.bind(this.onToggleMonitorEvents, this, elt, family, context)
  236 + });
  237 + }
  238 +
  239 + function onCommand(event)
  240 + {
  241 + Events.cancelEvent(event);
  242 +
  243 + var checked = this.areEventsMonitored(elt, null, context, false);
  244 + this.toggleMonitorEvents(elt, null, !checked, context);
  245 + }
  246 +
  247 + var item = {
  248 + label: "ShowEventsInConsole",
  249 + tooltiptext: "html.tip.Show_Events_In_Console",
  250 + id: "fbShowEventsInConsole",
  251 + type: "checkbox",
  252 + checked: this.areEventsMonitored(elt, null, context, false),
  253 + command: onCommand.bind(this),
  254 + items: logEventItems
  255 + };
  256 +
  257 + var logEventsItem = Menu.createMenuItem(popup, item, before);
  258 + var separator = Menu.createMenuItem(popup, "-", before);
  259 +
  260 + return items;
  261 + },
  262 +
  263 + onToggleMonitorEvents: function(event, elt, type, context)
  264 + {
  265 + var checked = event.target.getAttribute("checked") == "true";
  266 + this.toggleMonitorEvents(elt, type, checked, context);
  267 +
  268 + Events.cancelEvent(event);
  269 +
  270 + // Toggle the main "Log Events" option depending on whether all events are monitored.
  271 + var doc = event.target.ownerDocument;
  272 + var logEvents = doc.getElementById("fbShowEventsInConsole");
  273 + logEvents.setAttribute("checked", this.areEventsMonitored(elt, null, context, false));
  274 + },
  275 +});
173 276
174 277 // ********************************************************************************************* //
175 278 // Helpers
@@ -209,6 +312,62 @@ function getMonitoredEventTypes(types)
209 312 }
210 313
211 314 // ********************************************************************************************* //
  315 +// Rep Object
  316 +
  317 +var EventLog = function(event)
  318 +{
  319 + this.event = event;
  320 +};
  321 +
  322 +// ********************************************************************************************* //
  323 +// Rep Template
  324 +
  325 +with (Domplate) {
  326 +var EventLogRep = domplate(FirebugReps.Event,
  327 +{
  328 + className: "eventLog",
  329 +
  330 + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  331 +
  332 + tag:
  333 + TAG("$copyEventTag", {object: "$object|copyEvent"}),
  334 +
  335 + copyEventTag:
  336 + SPAN(
  337 + FirebugReps.OBJECTLINK("$object|summarizeEvent"),
  338 + SPAN("&nbsp"),
  339 + SPAN("&#187;"),
  340 + SPAN("&nbsp"),
  341 + TAG("$object|getTargetTag", {object: "$object|getTarget"})
  342 + ),
  343 +
  344 + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  345 +
  346 + copyEvent: function(log)
  347 + {
  348 + return new Dom.EventCopy(log.event);
  349 + },
  350 +
  351 + getTarget: function(event)
  352 + {
  353 + return event.target;
  354 + },
  355 +
  356 + getTargetTag: function(event)
  357 + {
  358 + var rep = Firebug.getRep(event.target);
  359 + return rep.shortTag ? rep.shortTag : rep.tag;
  360 + },
  361 +
  362 + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  363 +
  364 + supportsObject: function(object, type)
  365 + {
  366 + return object instanceof EventLog;
  367 + },
  368 +})};
  369 +
  370 +// ********************************************************************************************* //
212 371 // CommandLine Support
213 372
214 373 function monitorEvents(context, args)
@@ -233,6 +392,7 @@ function unmonitorEvents(context, args)
233 392 // Registration
234 393
235 394 Firebug.registerModule(EventMonitor);
  395 +Firebug.registerRep(EventLogRep);
236 396
237 397 Firebug.registerCommand("monitorEvents", {
238 398 handler: monitorEvents.bind(this),
2  extension/content/firebug/cookies/cookieReps.js
@@ -1027,7 +1027,7 @@ CookieReps.CookieTable = domplate(CookieReps.Rep,
1027 1027 TD({id: "colRawSize", role: "columnheader",
1028 1028 "class": "cookieHeaderCell a11yFocus"},
1029 1029 DIV({"class": "cookieHeaderCellBox",
1030   - title: Locale.$STR("cookies.header.size.tooltip")},
  1030 + title: Locale.$STR("cookies.header.rawSize.tooltip")},
1031 1031 Locale.$STR("cookies.header.rawSize"))
1032 1032 ),
1033 1033 TD({id: "colSize", role: "columnheader",
32 extension/content/firebug/css/computedPanel.js
@@ -34,6 +34,8 @@ const statusClasses = ["cssUnmatched", "cssParentMatch", "cssOverridden", "cssBe
34 34
35 35 try
36 36 {
  37 + // xxxHonza: broken by: https://bugzilla.mozilla.org/show_bug.cgi?id=855914
  38 + // waiting for: https://bugzilla.mozilla.org/show_bug.cgi?id=867595
37 39 Cu.import("resource:///modules/devtools/CssLogic.jsm");
38 40 }
39 41 catch (err)
@@ -138,10 +140,7 @@ CSSComputedPanel.prototype = Obj.extend(Firebug.Panel,
138 140
139 141 formatValue: function(value)
140 142 {
141   - if (Options.get("colorDisplay") == "hex")
142   - value = Css.rgbToHex(value);
143   - else if (Options.get("colorDisplay") == "hsl")
144   - value = Css.rgbToHSL(value);
  143 + value = formatColor(value);
145 144
146 145 var limit = Options.get("stringCropLength");
147 146 if (limit > 0)
@@ -610,7 +609,8 @@ CSSComputedPanel.prototype = Obj.extend(Firebug.Panel,
610 609 {
611 610 var propInfo = Firebug.getRepObject(target);
612 611
613   - var prop = propInfo.property, value = propInfo.value;
  612 + var prop = propInfo.property;
  613 + var value = formatColor(propInfo.value);
614 614 var cssValue;
615 615
616 616 if (prop == "font" || prop == "font-family")
@@ -700,7 +700,27 @@ CSSComputedPanel.prototype = Obj.extend(Firebug.Panel,
700 700 });
701 701
702 702 //********************************************************************************************* //
703   -//Helpers
  703 +// Helpers
  704 +
  705 +function formatColor(color)
  706 +{
  707 + var colorDisplay = Options.get("colorDisplay");
  708 +
  709 + switch (colorDisplay)
  710 + {
  711 + case "hex":
  712 + return Css.rgbToHex(color);
  713 +
  714 + case "hsl":
  715 + return Css.rgbToHSL(color);
  716 +
  717 + case "rgb":
  718 + return Css.colorNameToRGB(color);
  719 +
  720 + default:
  721 + return value;
  722 + }
  723 +}
704 724
705 725 const styleGroups =
706 726 {
298 extension/content/firebug/css/cssPanel.js
@@ -78,7 +78,7 @@ var CSSPropTag = domplate(CSSDomplateBase,
78 78 role: "option"},
79 79
80 80 // Use spaces for indent to make "copy to clipboard" nice.
81   - SPAN("&nbsp;&nbsp;&nbsp;&nbsp;"),
  81 + SPAN({"class": "cssPropIndent"}, "&nbsp;&nbsp;&nbsp;&nbsp;"),
82 82 SPAN({"class": "cssPropName", $editable: "$rule|isEditable"},
83 83 "$prop.name"
84 84 ),
@@ -125,6 +125,99 @@ var CSSCharsetRuleTag = domplate(CSSDomplateBase,
125 125 )
126 126 });
127 127
  128 +var CSSMediaRuleTag = domplate(CSSDomplateBase,
  129 +{
  130 + tag:
  131 + DIV({"class": "cssRule focusRow cssMediaRule", _repObject: "$rule.rule"},
  132 + DIV({"class": "cssHead focusRow", role : "listitem"},
  133 + SPAN({"class": "cssRuleName"}, "@media"),
  134 + SPAN({"class": "separator"}, " "),
  135 + SPAN({"class": "cssMediaRuleCondition", $editable: "$rule|isEditable"},
  136 + "$rule.rule.conditionText"),
  137 + SPAN(" {")
  138 + ),
  139 + DIV({"class": "cssRulesListBox", role: "listbox"},
  140 + FOR("subRule", "$rule.subRules",
  141 + TAG("$subRule.tag", {rule: "$subRule"})
  142 + )
  143 + ),
  144 + DIV({$editable: "$rule|isEditable", $insertBefore:"$rule|isEditable",
  145 + role:"presentation"},
  146 + "}")
  147 + )
  148 +});
  149 +
  150 +var CSSSupportsRuleTag = domplate(CSSDomplateBase,
  151 +{
  152 + tag:
  153 + DIV({"class": "cssRule focusRow cssSupportsRule", _repObject: "$rule.rule"},
  154 + DIV({"class": "cssHead focusRow", role : "listitem"},
  155 + SPAN({"class": "cssRuleName"}, "@supports"),
  156 + SPAN({"class": "separator"}, " "),
  157 + SPAN({"class": "cssSupportsRuleCondition", $editable: "$rule|isEditable"},
  158 + "$rule.rule.conditionText"),
  159 + SPAN(" {")
  160 + ),
  161 + DIV({"class": "cssRulesListBox", role: "listbox"},
  162 + FOR("subRule", "$rule.subRules",
  163 + TAG("$subRule.tag", {rule: "$subRule"})
  164 + )
  165 + ),
  166 + DIV({$editable: "$rule|isEditable", $insertBefore:"$rule|isEditable",
  167 + role:"presentation"},
  168 + "}")
  169 + )
  170 +});
  171 +
  172 +var CSSKeyframesRuleTag = domplate(CSSDomplateBase,
  173 +{
  174 + tag:
  175 + DIV({"class": "cssRule focusRow cssKeyframesRule", _repObject: "$rule.rule"},
  176 + DIV({"class": "cssHead focusRow", role : "listitem"},
  177 + SPAN({"class": "cssRuleName"}, "@-moz-keyframes"),
  178 + SPAN({"class": "separator"}, " "),
  179 + SPAN({"class": "cssKeyframesRuleName", $editable: "$rule|isEditable"},
  180 + "$rule.rule.name"),
  181 + SPAN(" {")
  182 + ),
  183 + DIV({"class": "cssRulesListBox", role: "listbox"},
  184 + FOR("subRule", "$rule.subRules",
  185 + TAG("$subRule.tag", {rule: "$subRule"})
  186 + )
  187 + ),
  188 + DIV({role:"presentation"},
  189 + "}")
  190 + )
  191 +});
  192 +
  193 +var CSSKeyframeRuleTag = domplate(CSSDomplateBase,
  194 +{
  195 + tag:
  196 + DIV({"class": "cssRule",
  197 + $cssEditableRule: "$rule|isEditable",
  198 + $insertInto: "$rule|isEditable",
  199 + $editGroup: "$rule|isSelectorEditable",
  200 + _repObject: "$rule.rule",
  201 + role: "presentation"},
  202 + DIV({"class": "cssHead focusRow", role: "listitem"},
  203 + SPAN({"class": "cssKeyText", $editable: "$rule|isEditable"},
  204 + "$rule.rule.keyText"),
  205 + " {"
  206 + ),
  207 + DIV({role: "group"},
  208 + DIV({"class": "cssPropertyListBox", _rule: "$rule", role: "listbox"},
  209 + FOR("prop", "$rule.props",
  210 + TAG(CSSPropTag.tag, {rule: "$rule", prop: "$prop"})
  211 + )
  212 + )
  213 + ),
  214 + DIV({$editable: "$rule|isEditable", $insertBefore: "$rule|isEditable",
  215 + role:"presentation"},
  216 + "}"
  217 + )
  218 + )
  219 +});
  220 +
128 221 var CSSNamespaceRuleTag = domplate(CSSDomplateBase,
129 222 {
130 223 tag:
@@ -200,6 +293,28 @@ var CSSPageRuleTag = domplate(CSSDomplateBase,
200 293 }
201 294 });
202 295
  296 +var CSSDocumentRuleTag = domplate(CSSDomplateBase,
  297 +{
  298 + tag:
  299 + DIV({"class": "cssRule focusRow cssDocumentRule", _repObject: "$rule.rule"},
  300 + DIV({"class": "cssHead focusRow", role : "listitem"},
  301 + SPAN({"class": "cssRuleName"}, "@-moz-document"),
  302 + SPAN({"class": "separator"}, " "),
  303 + SPAN({"class": "cssDocumentRuleCondition", $editable: "$rule|isEditable"},
  304 + "$rule.rule.conditionText"),
  305 + SPAN(" {")
  306 + ),
  307 + DIV({"class": "cssRulesListBox", role: "listbox"},
  308 + FOR("subRule", "$rule.subRules",
  309 + TAG("$subRule.tag", {rule: "$subRule"})
  310 + )
  311 + ),
  312 + DIV({$editable: "$rule|isEditable", $insertBefore:"$rule|isEditable",
  313 + role:"presentation"},
  314 + "}")
  315 + )
  316 +});
  317 +
203 318 var CSSStyleRuleTag = domplate(CSSDomplateBase,
204 319 {
205 320 tag:
@@ -430,10 +545,11 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
430 545
431 546 var isSystemSheet = Url.isSystemStyleSheet(styleSheet);
432 547
433   - var rules = [];
434   - var appendRules = function(cssRules)
  548 + var createRules = function(cssRules)
435 549 {
436   - var i, props;
  550 + var i;
  551 + var props;
  552 + var rules = [];
437 553
438 554 if (!cssRules)
439 555 return;
@@ -453,6 +569,15 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
453 569 isSelectorEditable: true
454 570 });
455 571 }
  572 + else if (window.CSSSupportsRule && rule instanceof window.CSSSupportsRule)
  573 + {
  574 + rules.push({
  575 + tag: CSSSupportsRuleTag.tag,
  576 + rule: rule,
  577 + subRules: createRules(Css.safeGetCSSRules(rule)),
  578 + isSystemSheet: isSystemSheet
  579 + });
  580 + }
456 581 else if (rule instanceof window.CSSImportRule)
457 582 {
458 583 rules.push({tag: CSSImportRuleTag.tag, rule: rule});
@@ -461,18 +586,33 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
461 586 {
462 587 rules.push({tag: CSSCharsetRuleTag.tag, rule: rule});
463 588 }
464   - else if (rule instanceof window.CSSMediaRule ||
465   - rule instanceof window.CSSMozDocumentRule)
  589 + else if (rule instanceof window.CSSMediaRule)
  590 + {
  591 + rules.push({
  592 + tag: CSSMediaRuleTag.tag,
  593 + rule: rule,
  594 + subRules: createRules(Css.safeGetCSSRules(rule)),
  595 + isSystemSheet: isSystemSheet
  596 + });
  597 + }
  598 + else if (rule instanceof window.CSSMozDocumentRule)
466 599 {
467   - appendRules(Css.safeGetCSSRules(rule));
  600 + rules.push({
  601 + tag: CSSDocumentRuleTag.tag,
  602 + rule: rule,
  603 + subRules: createRules(Css.safeGetCSSRules(rule)),
  604 + isSystemSheet: isSystemSheet
  605 + });
468 606 }
469 607 else if (rule instanceof window.CSSFontFaceRule)
470 608 {