Permalink
Browse files

Merge branch 'master' of github.com:firebug/firebug

  • Loading branch information...
2 parents 34c8d8a + c552c95 commit 843d0d01023a4e35aa0ced81d0bd0485c51c6bc9 @janodvarko janodvarko committed Sep 19, 2012
@@ -50,14 +50,6 @@ var CSSDomplateBase =
isSelectorEditable: function(rule)
{
return rule.isSelectorEditable && this.isEditable(rule);
- },
-
- getPropertyValue: function(prop)
- {
- var limit = Options.get("stringCropLength");
- if (limit > 0)
- return Str.cropString(prop.value, limit);
- return prop.value;
}
};
@@ -78,7 +70,7 @@ var CSSPropTag = domplate(CSSDomplateBase,
// Use a space here, so that "copy to clipboard" has it (issue 3266).
SPAN({"class": "cssColon"}, ": "),
SPAN({"class": "cssPropValue", $editable: "$rule|isEditable"},
- "$prop|getPropertyValue$prop.important"
+ "$prop.value$prop.important"
),
SPAN({"class": "cssSemi"}, ";"
)
@@ -1294,11 +1286,10 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
var propValue = Dom.getAncestorByClass(target, "cssPropValue");
if (propValue)
{
- var styleRule = Firebug.getRepObject(propValue);
+ var text = propValue.textContent;
var prop = Dom.getAncestorByClass(target, "cssProp");
var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
var propName = propNameNode.textContent.toLowerCase();
- var text = styleRule.style.getPropertyValue(propName);
var cssValue;
if (propName == "font" || propName == "font-family")
@@ -1681,11 +1672,12 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
this.panel.removeDisabledProperty(rule, propName);
}
+ target.textContent = value;
+
if (rule instanceof window.CSSStyleRule || rule instanceof window.Element)
{
if (Css.hasClass(target, "cssPropName"))
{
- target.textContent = value;
if (value && previousValue != value) // name of property has changed.
{
@@ -1724,9 +1716,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
}
else if (Dom.getAncestorByClass(target, "cssPropValue"))
{
- var limit = Options.get("stringCropLength");
- target.textContent = limit > 0 ? Str.cropString(value, limit) : value;
-
propName = Dom.getChildByClass(row, "cssPropName").textContent;
propValue = Dom.getChildByClass(row, "cssPropValue").textContent;
@@ -1772,8 +1761,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
}
else if (rule instanceof window.CSSImportRule && Css.hasClass(target, "cssMediaQuery"))
{
- target.textContent = value;
-
if (FBTrace.DBG_CSS)
{
FBTrace.sysout("CSSEditor.saveEdit: @import media query: " +
@@ -1792,8 +1779,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
}
else if (rule instanceof window.CSSCharsetRule)
{
- target.textContent = value;
-
if (FBTrace.DBG_CSS)
FBTrace.sysout("CSSEditor.saveEdit: @charset: " + previousValue + "->" + value);
@@ -1841,28 +1826,6 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
}
},
- getInitialValue: function(target, value)
- {
- if (value == "")
- return value;
-
- var propValue = Dom.getAncestorByClass(target, "cssPropValue");
- if (propValue)
- {
- var styleRule = Firebug.getRepObject(propValue);
- var prop = Dom.getAncestorByClass(target, "cssProp");
- var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
- var propName = propNameNode.textContent.toLowerCase();
- value = styleRule.style.getPropertyValue(propName);
-
- if (Options.get("colorDisplay") == "hex")
- value = Css.rgbToHex(value);
- else if (Options.get("colorDisplay") == "hsl")
- value = Css.rgbToHSL(value);
- }
- return value;
- },
-
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
getAutoCompleteRange: function(value, offset)
@@ -1124,9 +1124,12 @@ this.OneShotHandler = function(eventTarget, eventName, onEvent, capturing)
* Notice that FBTest automatically resets all preferences before every single test is executed.
* @param {Object} value New value of the preference.
*/
-this.setPref = function(pref, value)
+this.setPref = function(pref, value, prefDomain)
{
- FW.Firebug.setPref(FW.Firebug.prefDomain, pref, value);
+ if (!prefDomain)
+ prefDomain = FW.Firebug.prefDomain;
+
+ FW.Firebug.setPref(prefDomain, pref, value);
};
/**
@@ -5,6 +5,12 @@ function runTest()
FBTest.openNewTab(basePath + "net/4905/issue4905.html", function(win)
{
FBTest.openFirebug();
+
+ // Enable browser cache
+ var browserCache = FW.Firebug.NetMonitor.BrowserCache;
+ var browserCacheEnabled = browserCache.isEnabled();
+ browserCache.toggle(true);
+
FBTest.selectPanel("net");
FBTest.enableNetPanel();
@@ -15,7 +21,7 @@ function runTest()
counter: 2
};
- FBTest.waitForDisplayedElement("net", options, function(row)
+ var callbackFunction = function(row)
{
var panelNode = FBTest.selectPanel("net").panelNode;
@@ -36,8 +42,14 @@ function runTest()
"Cached response headers must include 'Cache-Control' header");
}
+ // Disable browser cache again if it was disabled before
+ if (!browserCacheEnabled)
+ browserCache.toggle(false);
+
FBTest.testDone("issue4905.DONE");
- });
+ };
+
+ FBTest.waitForDisplayedElement("net", options, callbackFunction);
FBTest.reload();
});

0 comments on commit 843d0d0

Please sign in to comment.