Permalink
Browse files

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

  • Loading branch information...
2 parents c72c8d1 + ab3bed9 commit da0ab650e399dfb8c7ac99b4785c073416f9b30c @janodvarko janodvarko committed Aug 17, 2012
@@ -371,8 +371,12 @@ var Errors = Firebug.Errors = Obj.extend(Firebug.Module,
correctLineNumbersOnExceptions(object, error);
}
- if (Firebug.showStackTrace && Firebug.errorStackTrace)
+ if (Firebug.errorStackTrace)
+ {
error.correctWithStackTrace(Firebug.errorStackTrace);
+ if (!Firebug.showStackTrace)
+ error.trace = null;
+ }
var msgId = lessTalkMoreAction(context, object, isWarning);
if (!msgId)
@@ -670,6 +670,7 @@ CSSComputedPanel.prototype = Obj.extend(Firebug.Panel,
return CSSInfoTip.populateImageInfoTip(infoTip, absURL, repeat);
}
+ break;
case "fontFamily":
return CSSInfoTip.populateFontFamilyInfoTip(infoTip, cssValue.value);
@@ -678,6 +679,8 @@ CSSComputedPanel.prototype = Obj.extend(Firebug.Panel,
delete this.infoTipType;
delete this.infoTipValue;
delete this.infoTipObject;
+
+ return false;
}
},
@@ -1303,6 +1303,7 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
return CSSInfoTip.populateImageInfoTip(infoTip, absURL, repeat);
}
+ break;
case "fontFamily":
return CSSInfoTip.populateFontFamilyInfoTip(infoTip, cssValue.value);
@@ -1311,6 +1312,8 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
delete this.infoTipType;
delete this.infoTipValue;
delete this.infoTipObject;
+
+ return false;
}
},
@@ -95,12 +95,12 @@ CSSStylePanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
getSeparator: function(part)
{
- if (part.type == "otherProps")
- return " ";
-
if (part.lastFont || part.type == "important")
return "";
+ if (part.type == "otherProps")
+ return " ";
+
return ",";
},
@@ -827,7 +827,11 @@ function getFontPropValueParts(element, value, propName)
);
var matches = rePreFont.exec(value);
if (!matches)
- return;
+ {
+ // Non-simple font value, like "inherit", "status-bar" or
+ // "-moz-calc(12px) Arial" - just return the whole text.
+ return [{type: "otherProps", value: value, lastFont: true}];
+ }
var preProps = matches[0].slice(0, -1);
parts.push({type: "otherProps", value: preProps});
value = value.substr(matches[0].length);
@@ -78,7 +78,7 @@ Fonts.getFontsUsedInContext = function(context)
* Retrieves the information about a font
* @context: Context of the font
* @win: Window the font is used in
- * @identifier: Either a URL in case of a Fonts font or the font name
+ * @identifier: Either a URL in case of a web font or the font name
* @return Object with information about the font
*/
Fonts.getFontInfo = function(context, win, identifier)
@@ -94,15 +94,15 @@ Fonts.getFontInfo = function(context, win, identifier)
}
var fonts = Fonts.getFonts(doc.documentElement);
- var url = Url.splitURLBase(identifier);
if (FBTrace.DBG_FONTS)
- FBTrace.sysout("Fonts.getFontInfo;", {fonts:fonts, url:url});
+ FBTrace.sysout("Fonts.getFontInfo;", {fonts:fonts, identifier: identifier});
for (var i=0; i<fonts.length; i++)
{
- if ((fonts[i].rule && url && identifier == fonts[i].URI) ||
- identifier == fonts[i].CSSFamilyName || identifier == fonts[i].name)
+ if (identifier == fonts[i].URI ||
+ identifier.toLowerCase() == fonts[i].CSSFamilyName.toLowerCase() ||
+ identifier.toLowerCase() == fonts[i].name.toLowerCase())
{
return fonts[i];
}
@@ -313,6 +313,20 @@ Url.getPrettyDomain = function(url)
return m ? m[2] : "";
};
+/**
+ * Returns the base URL for a given window
+ * @param {Object} win DOM window
+ * @returns {String} Base URL
+ */
+Url.getBaseURL = function(win)
+{
+ if (!win)
+ return;
+
+ var base = win.document.getElementsByTagName("base").item(0);
+ return base ? base.href : win.location.href;
+};
+
Url.absoluteURL = function(url, baseURL)
{
// Replace "/./" with "/" using regular expressions (don't use string since /./
@@ -508,6 +522,17 @@ Url.reEncodeURL = function(file, text, noLimit)
return url;
};
+/**
+ * Extracts the URL from a CSS URL definition.
+ * Example: url(../path/to/file) => ../path/to/file
+ * @param {String} url CSS URL definition
+ * @returns {String} Extracted URL
+ */
+Url.extractFromCSS = function(url)
+{
+ return url.replace(/^url\(["']?(.*?)["']?\)$/, "$1");
+};
+
Url.makeURI = function(urlString)
{
try

0 comments on commit da0ab65

Please sign in to comment.