Permalink
Browse files

[1.9] Backporting from 1.10; revisions: 12651, 12652, 12653, 12656, 1…

…2657, 12659, 12662, 12668, 12669, 12670, 12683, 12684, 12685, 12686; issues: 5092, 3442, 5114, 5111, 5109, 4996
  • Loading branch information...
1 parent 1ad2086 commit fcf1c3c90a68bac68610263a4b5e1c5ffe4ac0d9 @janodvarko janodvarko committed Apr 12, 2012
@@ -1756,7 +1756,13 @@ function browser1Loaded()
browser1.complete = true;
if (browser1.complete && browser2.complete)
- FirebugChrome.initializeUI();
+ {
+ // initializeUI is executed asynchronously, which solves the issue 3442
+ // The problem has been introduced (from unknown reason) by revision R12210
+ setTimeout(function() {
+ FirebugChrome.initializeUI(); // the chrome bound into this scope
+ });
+ }
if (FBTrace.DBG_INITIALIZE)
FBTrace.sysout("browse1Loaded complete\n");
@@ -1775,7 +1781,12 @@ function browser2Loaded()
browser2.complete = true;
if (browser1.complete && browser2.complete)
- FirebugChrome.initializeUI(); // the chrome bound into this scope
+ {
+ // See browser1Loaded for more info.
+ setTimeout(function() {
+ FirebugChrome.initializeUI(); // the chrome bound into this scope
+ });
+ }
if (FBTrace.DBG_INITIALIZE)
FBTrace.sysout("browse2Loaded complete\n");
@@ -1420,7 +1420,7 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
{
propName = value.replace(/-./g, function(match)
{
- match[1].toUpperCase()
+ return match[1].toUpperCase()
});
if(propName in rule.style || propName == "float")
@@ -1418,7 +1418,7 @@
</xul:textbox>
<xul:description anonid="fbSearchBoxDescription" collapsed="true"/>
<xul:panel id="fbSearchOptionsPanel" norestorefocus="true" noautofocus="true"
- noautohide="true" ignorekeys="true" role="presentation">
+ ignorekeys="true" role="presentation">
<xul:description id="fbSearchBoxIsSensitive" value="search.Case AutoSensitive"/>
<xul:description id="fbSearchBoxIsNotSensitive" value="search.Case Insensitive"/>
<xul:vbox class="searchOptionsMenu innerToolbar" role="menu" anonid="fbSearchOptionsMenu">
@@ -1446,15 +1446,22 @@
this.onFocusSearchBox = function(event)
{
self.focusHandler(event);
- }
+ };
this.onFocusOptionsPopup = function(event)
{
self.panelFocusHandler(event);
- }
+ };
searchBox.addEventListener("focus", this.onFocusSearchBox, true);
optionsPopup.addEventListener("focus", this.onFocusOptionsPopup, true);
+
+ // Dynamically set noautohide to avoid mozilla bug 545265.
+ optionsPopup.addEventListener("popupshowing", function runOnce()
+ {
+ optionsPopup.removeEventListener("popupshowing", runOnce, false);
+ optionsPopup.setAttribute("noautohide", true);
+ }, false);
]]></constructor>
<destructor><![CDATA[
@@ -1517,7 +1524,19 @@
<!-- Flag indicating that the child of the panel has or just had focus -->
<field name="panelHasFocus" />
- <field name="blurTimeout" />
+
+ <!-- Timer to close the popup, set on blur. Any kind of focus that directly follows
+ the blur should clear it with clearBlurTimeout(). -->
+ <field name="blurTimeout">null</field>
+
+ <method name="clearBlurTimeout">
+ <body><![CDATA[
+ if (this.blurTimeout !== null) {
+ clearTimeout(this.blurTimeout);
+ this.blurTimeout = null;
+ }
+ ]]></body>
+ </method>
<method name="updateOptions">
<parameter name="menuItems" />
@@ -1574,8 +1593,7 @@
popupBoxObject.setConsumeRollupEvent(popupBoxObject.ROLLUP_NO_CONSUME);
optionsPopup.openPopup(this, position, 0, 0, false, false);
- clearTimeout(this.blurTimeout);
- delete this.blurTimeout;
+ this.clearBlurTimeout();
]]></body>
</method>
@@ -1584,8 +1602,7 @@
var optionsPopup = document.getElementById("fbSearchOptionsPanel");
optionsPopup.hidePopup();
- clearTimeout(this.blurTimeout);
- delete this.blurTimeout;
+ this.clearBlurTimeout();
]]></body>
</method>
@@ -1623,11 +1640,10 @@
<method name="focusHandler">
<parameter name="event" />
<body><![CDATA[
- var target = event.target;
- clearTimeout(this.blurTimeout);
- delete this.blurTimeout;
+ this.panelHasFocus = false;
+ this.clearBlurTimeout();
- if (!FBL.hasClass(target, "panelFocusBound"))
+ if (!FBL.hasClass(event.target, "panelFocusBound") && !this.optionsShown)
{
this.showOptions();
}
@@ -1637,7 +1653,7 @@
<method name="panelFocusHandler">
<parameter name="event" />
<body><![CDATA[
- this.focusHandler(event);
+ this.clearBlurTimeout();
if (!FBL.hasClass(event.target, "panelFocusBound"))
this.panelHasFocus = true;
@@ -1646,8 +1662,7 @@
<method name="endTextFocusHandler">
<body><![CDATA[
- clearTimeout(this.blurTimeout);
- delete this.blurTimeout;
+ this.clearBlurTimeout();
if (this.panelHasFocus)
{
@@ -1682,6 +1697,7 @@
var searchBox = document.getAnonymousElementByAttribute(this, "anonid",
"searchBox");
searchBox.focus();
+ this.panelHasFocus = false;
}
else
{
@@ -1748,7 +1764,7 @@
}
if (!this.focused)
- this.focus()
+ this.focus();
]]></body>
</method>
</implementation>
@@ -1813,12 +1829,13 @@
]]></handler>
<handler event="blur" phase="capturing"><![CDATA[
- this.blurTimeout = (this.blurTimeout || setTimeout(function()
+ this.clearBlurTimeout();
+ this.blurTimeout = setTimeout(function()
{
hideOptions();
status = "noSearch";
focused = false;
- }, 0));
+ }, 0);
]]></handler>
</handlers>
</binding>
@@ -151,6 +151,11 @@ Firebug.Debugger = Obj.extend(Firebug.ActivableModule,
{
var prop = listValue.value[i];
var name = Wrapper.unwrapIValue(prop.name);
+
+ // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=712289.
+ if (typeof name !== "string")
+ break;
+
names.push(name);
}
@@ -1050,6 +1050,9 @@ Firebug.ScriptPanel.prototype = Obj.extend(Firebug.SourceBoxPanel,
// Delete any sourceBoxes that are not in sync with compilationUnits
refresh: function()
{
+ var previousCentralLine;
+ var previousUrl;
+
for (var url in this.sourceBoxes)
{
if (this.sourceBoxes.hasOwnProperty(url))
@@ -1064,8 +1067,11 @@ Firebug.ScriptPanel.prototype = Obj.extend(Firebug.SourceBoxPanel,
delete this.sourceBoxes[url];
if (this.selectedSourceBox == victim)
{
- Dom.collapse(this.selectedSourceBox, true);
- delete this.selectedSourceBox;
+ previousCentralLine = this.selectedSourceBox.centralLine;
+ previousUrl = this.getSourceBoxURL(this.selectedSourceBox);
+
+ Dom.collapse(this.selectedSourceBox, true);
+ delete this.selectedSourceBox;
}
if (FBTrace.DBG_COMPILATION_UNITS)
@@ -1077,7 +1083,17 @@ Firebug.ScriptPanel.prototype = Obj.extend(Firebug.SourceBoxPanel,
// If selectedSourceBox is undefined, then show() has not run,
// but we have to refresh, so do the default.
if (!this.selectedSourceBox)
+ {
this.navigate();
+
+ // Restore the scroll position (issue 5111)
+ if (this.selectedSourceBox)
+ {
+ var url = this.getSourceBoxURL(this.selectedSourceBox);
+ if (this.selectedSourceBox && url == previousUrl)
+ this.scrollToLine(null, previousCentralLine);
+ }
+ }
},
updateLocation: function(compilationUnit)
@@ -1853,4 +1869,4 @@ Firebug.registerPanel(Firebug.ScriptPanel);
return Firebug.ScriptPanel;
// ********************************************************************************************* //
-});
+});
@@ -15,7 +15,12 @@ var Events = {};
Events.dispatch = function(listeners, name, args)
{
if (!listeners)
+ {
+ if (FBTrace.DBG_DISPATCH)
+ FBTrace.sysout("Events.dispatch "+name+" without listeners");
+
return;
+ }
try
{
@@ -80,6 +80,11 @@ Wrapper.unwrapIValueObject = function(scope, viewChrome)
{
var prop = listValue.value[i];
var name = Wrapper.unwrapIValue(prop.name);
+
+ // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=712289.
+ if (typeof name !== "string")
+ break;
+
if (prop.value.jsType === prop.value.TYPE_NULL) // null is an object (!)
scopeVars[name] = null;
else
@@ -1210,19 +1210,17 @@ function delayGetCacheEntry(file, netProgress)
];
// Get contentType from the cache.
- descriptor.visitMetaData(
+ try
{
- visitMetaDataElement: function(key, value)
- {
- if (key == "response-head")
- {
- var contentType = getContentTypeFromResponseHead(value);
- file.mimeType = NetUtils.getMimeType(contentType, file.href);
- return false;
- }
- return true;
- }
- });
+ var value = descriptor.getMetaDataElement("response-head");
+ var contentType = getContentTypeFromResponseHead(value);
+ file.mimeType = NetUtils.getMimeType(contentType, file.href);
+ }
+ catch (e)
+ {
+ if (FBTrace.DBG_ERRORS)
+ FBTrace.sysout("net.delayGetCacheEntry; EXCEPTION ", e);
+ }
descriptor.close();
netProgress.update(file);
@@ -131,7 +131,12 @@ Firebug.Spy = Obj.extend(Firebug.Module,
{
// XXXjjb Honza, if Console.isEnabled(context) false, then this can't be called,
// but somehow seems not correct
- if (name == "showXMLHttpRequests")
+
+ // XHR Spy needs to be detached/attached when:
+ // 1) The Show XMLHttpRequests options is off/on
+ // 2) The Console panel is disabled/enabled
+ // See also issue 5109
+ if (name == "showXMLHttpRequests" || name == "console.enableSites")
{
var tach = value ? this.attachObserver : this.detachObserver;
View
@@ -44,6 +44,7 @@
<em:contributor>Steven Roussey (Illuminations for Developers)</em:contributor>
<em:contributor>Sebastian Zartner</em:contributor>
<em:contributor>Harutyun Amirjanyan</em:contributor>
+ <em:contributor>Simon Lindholm</em:contributor>
<em:iconURL>chrome://firebug/skin/firebug64.png</em:iconURL>
<em:homepageURL>http://www.getfirebug.com/</em:homepageURL>
@@ -44,6 +44,7 @@
<em:contributor>Steven Roussey (Illuminations for Developers)</em:contributor>
<em:contributor>Sebastian Zartner</em:contributor>
<em:contributor>Harutyun Amirjanyan</em:contributor>
+ <em:contributor>Simon Lindholm</em:contributor>
<em:iconURL>chrome://firebug/skin/firebug64.png</em:iconURL>
<em:homepageURL>http://www.getfirebug.com/</em:homepageURL>

0 comments on commit fcf1c3c

Please sign in to comment.